Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So i would wanted to send a reminder email if reach 2 days before the Actual Date.
Example: Assuming today is 8th & the Actual Date is 10th so it will send a reminder email out.

So i've write the email store procedure, it is able to send but i need to add the condition which i mentioned on above

What I have tried:

IF Action = 'Reminder Mail To Customer' THEN
  set Content = (SELECT CONCAT('<p>Dear ',a.Name,',</p><p> This is to remind that the your birthday ',a.BirthDate, ', is almost here ,do visit us & get ',b.Dis.' discount from us.</p> <p>Sincerely,<br>YOURS WW</p>') FROM customer_dtl a inner join percentage_dis b on a.ID = b.DisID  WHERE a.ID = Get_Id and b.ID = Get_ThisId);
  set Subject = (SELECT CONCAT(a.CusNo,' Reminder Mail To Customer') FROM customer_dtl a WHERE a.ID = Get_Id);
END IF;
Posted
Updated 30-Nov-20 17:05pm
v3
Comments
Richard MacCutchan 1-Dec-20 3:58am    
Compare the current date to the stored date.
BabyYoda 1-Dec-20 13:07pm    
Add a WHERE clause to indicate you just want the ones that are within the next 2 days.

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