Last post Jan 07, 2014 03:15 PM by AidyF
Jan 07, 2014 12:24 PMfirstname.lastname@example.org|LINK
Let start by saying I want to do my project in MVC 5. I am trying to implement an idea and I would like to get an advice to the best approach. For example if we have an application where a user can enter a date for an appointment. Also the user can select
few dates PRIOR to the appointment date (I know how to do all this). My question is how the user can receive email reminders for the dates selected PRIOR to the appointment date?? I was thinking a windows service that constantly runs in the background and
checks the database for prior dates and then when it finds one, it calls a web api to send an email. Is this the BEST way?? If it is can you please refer me to a reference that does that in MVC 5 or similar? Thank you.
Jan 07, 2014 12:53 PM|AidyF|LINK
Windows Services are totally separate from MVC, they are their own technology. You could get it to send its own emails too, no need to call a web api to send an email, however it would probably be a good idea for it to call a web api/web service of some
sort to work out what people are due emails rather that it having direct access to the data. I'd also plan of tracking when a specific reminder has been sent for a each person. That way your service will be a bit more robust and be able to process in the
event of network errors, OS crashes/reboots etc.
Jan 07, 2014 03:07 PMemail@example.com|LINK
Thank you, I like your last comment it makes sense. I could not find one reference on Google where a windows service calls a web api as an example, do you of any?
Jan 07, 2014 03:15 PM|AidyF|LINK
Code inside a service is no different from any other code. The code that calls the api from a web page will work just as well. You only have to bear in mind the security aspect of things, and the fact that you should remember there might be no desktop
and no-one logged into the machine. The code is running as the user the service is defined to run under so you have to ensure that user has the rights to do what you want to do.