Sending Email on button click

0
I have a database with title, message, IsSent, ServiceDate and email Id. If my ServiceDate is equal to current date then I should get email with title and message when I click a Button. Different title has different ServiceDate and email Id.  I have imported Email with template module along with encryption and Mx reflector. I am able to sent email using these modules but I cannot implement this into my project.  Plese guide me through
asked
1 answers
0

Hi Dipika,

There's two ways to this.

First one with your button:

- Attach microflow to your button

- Create a variable endDate at the start of dateTime with expression addDays('[%BeginOfCurrentDayUTC%]',1)

- Retrieve in your microflow from database all objects with Servicedate > '[%BeginOfCurrentDayUTC%]' and ServiceDate < $endDate //These are all objects for which an email needs to be sent

- Place a loop and iterate over your objects. In your iterator, place the SendEmail functionality and pass the neccesary parameters based on your objects)

 

Second option would be to place the retrieve, iterator and send email in a scheduled event which runs once a day you wouldn't need to press the button each day.

 

Good luck.

answered