I am a beginner in azure, previously I had a logic app
That it had a timer that runs an enpoint every day to check which employees have their birthday to send an email.
I would like not to review employees' birthdays every day, since there will be more types of notifications to send.
What do you recommend me to do or what service in Azure to use?
When I detect that an employee whose birthday is registered on December 26, for example, I can programmatically create a Schedule event in Azure , which can be executed every December 26, so that it calls my enpoit birthday.
• My endpoints are developed in ASP NET CORE 6
• My DB is in PostgreSQL
I do not know what is the total number of user. But for 2 users you will end with 2 schedules. If you have 1000 users... you will have 1000 Schedules? what happen if at least 2 have the same date?
Maybe you need to think in another approach. You can trigger a single schedule, to check birthdays every single day, and then put a message in Service Bus, where your birthday module will take the message and send the notification for the user.
Sorry just an idea. :D
Related
I have a number of users who are currently subscribers to a monthly subscription.
For business reason, I want to be able to
1) Charge the customer when he decides to subscribe to our plan
2) Let the subscription become effective a number of days after the purchase
Currently a charge is immediately attempted when a subscription is added to a customer in stripe.
I want to stick to the stripe subscription because a) I still want to have stripe to manage subscription for me in future dates, and b) I have written a lot of code for the subscription model.
Is it feasible at all to demarcate the charge/invoice and the subscription start date?
You can control the time when the subscription actually starts (i.e. when Stripe will start billing the customer) by using the trial_end parameter in your subscription creation request. Simply set the value of the parameter to the timestamp of the exact time you wish Stripe to start automatically billing the customer.
If I understand your desired payment flow correctly, you'd want to do something like this when a customer signs up:
Collect and tokenize the customer's payment information (using Elements or Checkout).
Using the resulting token, create a customer object and save the resulting customer ID in your database.
Create a one-off charge using the customer object for the first payment.
Create a subscription using the customer object and the trial_end parameter set to the time you want Stripe to start automatically billing the customer.
See https://stripe.com/docs/subscriptions/trials for more information about using trial periods.
This is possible now through Stripe Subscription Schedules. With that, you can create a one phase schedule that starts in the future. By default, this will start the subscription on the date you want, automatically renew, and charge the customer on the start date. Also by default, it will immediately perform a transaction to pay for the subscription.
I found the required iterations to be a bit confusing. Essentially that is a multiplier against how many times the original price's interval repeats before moving on.
If all you want to do is start a subscription price in the future, use the Subscription Schedule API call. Create an items array of 1. Set the price_id of the price, the iterations on that item, and the start_date to the unix timestamp you want to start the subscription.
Stripe has different use cases for subscription schedules. The first one they list is exactly this purpose, starting and charging a subscription on a future date. Look through them if you want to adjust some more, like making the first phase a trial period instead.
I would like to implement automatic email notification system for recurring billing in Nodejs. E.g. when subscription is about to expire in 5 days or in 24 hours I want to send an email reminder for a user.
I am using Sendgrid as mailing service. Sending an email is a easy task. Question is what is the best practice for implementing such workflow.
I imagine that cronjob could be setup to run every hour or so.
Script is executed that finds all the users with subscriptions which expires in 5 days or 24 hours. Doing so would lead to sending notification every time cronjob is run. I have to track which users are notified already to avoid duplicated emails.
You should create a cron job for that, like I said in comment, daily. After you find and sent emails you can check sendgrid api to make sure email has been delivered.
https://sendgrid.com/docs/Glossary/deliveries.html
You can also make a web hook to check that
https://sendgrid.com/docs/API_Reference/Webhooks/event.html
the rest of implementation in logic.
I plan to publish an Windows Universal application to the Window Store. Do you think it's possible to create a recurring fee for this app ?
This way, the users will pay a small fee each month versus a one time fee at purchase time.
Thanks,
Julien
you can sell Consumable IAP, check each time user by it (once a month ?) and active features accordingly.
If you adding licensing in your application you are using
LicenseInformation class
This class has ExpirationDate property - that means date when app license expired
Usualy it is used for making Trial period, but you can try to combine it with app purchase anf licence will be sold every time for some period only
For my Azure app I have a variety of scenarios for needing both scheduled and triggers jobs. Having researched both Azure WebJobs and Scheduler it appears I can accomplish this, but not in the best way possible.
My use cases will go something like:
Weekly email blast (seems right up the alley for Scheduler)
Event invites, dynamically timed based on event's time (I could have
a job check every hour to see if any need to be sent? or at the
event's creation create a Scheduled Job at the specific time, but
what happens if the event changes?)
Reminders based on #2 above
(same issues/questions)
Welcome emails (two versions, one if they
complete a walkthrough and another if they don't: how to manage the
timing of this?)
So basically I see how I can use Azure Scheduler to accomplish all of this, but not in the most efficient way. I would like to see if there's a way to manage Azure Scheduler along with some sort of triggered Jobs based on various criteria, controller by code. Does something like this exist?
Update
To add a bit more information to this,
I'm using Mandrill as these are transactional emails. The things that makes my use case not appropriate for Mailchimp or some automation platform is I have repeat templates I will be sending out (5ish) which are triggered dynamically based on my user's events and various configurations.
Examples:
1) New user registers. If they complete an on-boarding walkthrough they receive one type of welcome email, if they don't complete the on-boarding walkthrough within x minutes they receive an other type of welcome email.
2) An event is created by an admin. At that moment code will comb through all users to see who should be invited based on user's preferences, then send out personalized invites to each user.
Consider using the WebJobs SDK for some of this. For example, you could use an Azure Storage Queue to invoke your web job as event invites are created or modified in your application. You may want to have different queues that different web jobs are triggered from too. For example, one for invites, another for reminders, and one for welcome emails.
The weekly email blast may be a separate scheduled web job in your scenario.
Putting my business cap on, it sounds like you have a need of something that will handle your email marketing/automation. Consider looking at 3rd party products that specialize in this, instead of hand-coding it. Mailchimp # http://mailchimp.com comes to mind. They have a feature called Goal completion more info at: http://blog.mailchimp.com/new-trigger-emails-from-website-traffic/
Alternatively, a monitoring and automation service that my company provides (CloudMonix # http://cloudmonix.com ) allows for automatically kicking off tasks based on some very custom criteria. CloudMonix knows nothing about email marketing, but it can kick-off a Web job or an Azure automation job if some SQL record appeared in the database or a metric published somewhere.
Context: We allow users to subscribe to our content by using Paymill subscriptions (monthly or yearly). The user can cancel the subscription at any time, which will remove any future transactions under their client account, but not the current transaction (ex current month or year). We do this by using subscription.setCancelAtPeriodEnd(true); when the users cancels their subscription. Also, as you can see, we are using the Java paymill-java library.
Question: The only missing bit is to actually cancel their content in our app when the current period ends. So, is there a webhook for EventType.SUBSCRIPTION_CANCELLED which will be called at the actual period end ? I see there is a EventType.SUBSCRIPTION_DELETED webhook, but I presume this won't work as we don't actually delete the subscription. I know there are probably other solutions to this matter, like managing the cancelled period end in our app, but this would be much more cumbersome than just using a webhook. At least IMHO.
there are some new webhooks with the subscription v2.1 coming out last week. For example
* subscription.expiring: returns a subscription-object
* subscription.deactivated: returns a subscription-object
* subscription.activated: returns a subscription-object
* subscription.canceled: returns a subscription-object
Have a look at https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#events
Think yours is the subscription canceled one but you need to make the subscription creation with the api v2.1.