Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, what is the best way to send e-mail reminders at a given time in ASP.NET Core, once per week? It needs to happen every week, to users who made requests at least 7 days. Those requests are stored in the database hosted on Azure.

What I have tried:

So far I've came with idea of creating a web job on Azure, which checks database for unfinished requests older than 7 days, with cron scheduling when to send out reminders. Is there a better way to do it?
Posted
Updated 22-Dec-21 2:39am

1 solution

Don't do it in .Net - let the database do it.

Setup a job that sends the reminders every day at a specific time. Keep in mind that you'll probably need to setup a no-reply email account in order to use an SMTP server.

Don't forget to give the user an opportunity to opt-out of the notifications.
 
Share this answer
 
Comments
Member 15341738 23-Dec-21 4:36am    
Unfortunately sending emails is not possible in Azure SQL Server, which we are using (as far as I know).
#realJSOP 23-Dec-21 8:15am    
You could

0) When the user logs on to the web app, if a request has expired, force them to either finish it or cancel it before they can create a new one. (this doesn't require any additional crap running or database/CRON jobs). This is probably the way I'd prefer to do it, because it's what I call a "natural" event, as opposed to a "subsidized" event that is trigger by an outside source.

-OR-

1) Create a Windows service on the web server that checks for unfinished requests once per day and handles the email chores.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900