Simple Email Notification
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: September 26, 2016 (RSS)
Hello, All -
I want to create a simple notification plugin that will send an email whenever a record is added to the DB. It would work a little like Djulia's "AlertRecordSaved" plugin which is available to download - except in one important respect.
The records in question are not added to the DB directly via CMSB but by a script. (IPN responses from PayPal).
In this instance I am not entirely sure how I would...
a) Capture the new entry save action
b) Pull the details of the new entry into the plugin
As I say I am looking for a really simple understanding of how to achieve this. Can anyone point me in the right direction?
Thanks,
Perch
By ross - September 26, 2016
Hi Perch
Thanks for posting.
Are you familiar with the CMS function: sendMessage()?
I assume you already have the script setup and working that creates the records after a successful PayPal transaction.
In that script, right after the code that creates the record, you can use the sendMessage() function to send out an email.
I recommend using an email template as well.
Because you are running sendMessage() after the code that creates your new record, you will have the record number and can look up any other details you need for the email and pass them all via placeholders to your email template.
Does that make sense?
Let me know any questions or feedback.
Thanks!
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/