Hello, please I need help to figure how to achieve this.
I have two tables called 'Renewals' and 'Pending Renewals'. Renewals stores client information, while Pending Renewals has a lookup field from the Renewals table called 'Tracking No.'
Whenever Pending Renewals is inserted/updated, I need an email notification to be sent to the client's email in the Renewals table (i.e. the email in the field in the Renewals table that corresponds to the Tracking No. in the Pending Renewals table).
Thanks.
Email Notifications
Re: Email Notifications
What version are you using? (It is always handy, before replying, to know the version - in all my posts where I ask questions or put solutions I put in the version # I am using. Ex: 5.3.1)
Also all you need to do is write some code and place it in the hook file for Pending Renewals.
You would first use a query to get the record from Renewals that matches your tracking number and extract the email address. Then you just use some more code to send an email. Use the mail function in php. See this reference.
http://www.w3schools.com/php/func_mail_mail.asp
It is fairly simple coding depending upon your structure. I would also recommend writing some code to update another table to put in the date and time an email was sent to each person. This way you also have a way of tracking when it was sent. The reason for another table is so that you can see, at a glance, when you sent it and also how many times. This can prevent unwanted or annoying emails. You can then extend this one step further and have code which first counts the # of times you have sent a reminder email to this person and limit it to some maximum number.
Or you can add a field to an existing table and use some code to increment a value each time you send an email reminder. This could be added to the Pending Renewals table. It would also be fairly simple to add a function to allow you to send email to all users in the pending table and then increment the counter. And you could take it one step further - add in a field which places the date/time the email was sent. This gives you a record of when you sent to each person.
Hope this helps a bit. I know it is not a coded solution but it does give you various options.
Alan
Also all you need to do is write some code and place it in the hook file for Pending Renewals.
You would first use a query to get the record from Renewals that matches your tracking number and extract the email address. Then you just use some more code to send an email. Use the mail function in php. See this reference.
http://www.w3schools.com/php/func_mail_mail.asp
It is fairly simple coding depending upon your structure. I would also recommend writing some code to update another table to put in the date and time an email was sent to each person. This way you also have a way of tracking when it was sent. The reason for another table is so that you can see, at a glance, when you sent it and also how many times. This can prevent unwanted or annoying emails. You can then extend this one step further and have code which first counts the # of times you have sent a reminder email to this person and limit it to some maximum number.
Or you can add a field to an existing table and use some code to increment a value each time you send an email reminder. This could be added to the Pending Renewals table. It would also be fairly simple to add a function to allow you to send email to all users in the pending table and then increment the counter. And you could take it one step further - add in a field which places the date/time the email was sent. This gives you a record of when you sent to each person.
Hope this helps a bit. I know it is not a coded solution but it does give you various options.
Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -
Re: Email Notifications
Thanks for your reply, will try out the options.
My version of Appgini is 5.30
My version of Appgini is 5.30