Email Plugin

By nmsinc - August 30, 2011

[font "Times New Roman"]Using CMS 2.11



I have two databases, each with multiple contact email addresses for each record saved. The first is for an Insurance Company, which includes name, address and several email contacts. The second is the agent database, which contains the Agent’s name, address and several email contacts.



These two databases are used to populate a third database by choosing the Insurance Company name and the Agent’s name.



I’m looking for a plug-in that will send an email to the email addresses within the records used to populate the third database when a record is saved or updated!



I checked out the “AlertRecordSaved” plug-in by Djulia and it only emails the admin and does not allow for easy setup of secondary email communications.



Any suggestions?



Thanks

Ray

[/#000000]

nmsinc

Re: [nmsinc] Email Plugin

By Djulia - August 31, 2011 - edited: September 9, 2011

Hi,

[font "Times New Roman"]> I checked out the “AlertRecordSaved” plug-in by Djulia and it only emails the admin and does not allow for easy setup of secondary email communications.
You can perhaps use bcc ?
'bcc' => Your email.

Djulia

Re: [Djulia] Email Plugin

By nmsinc - August 31, 2011

Hi Djulia,[/#000000]



Two questions:



I’m looking over the code for your plug-in – can the user open multiple tables on line 18?



Also, I propagate a third database table using information from two others by choosing the name of an Insurance Co. from one and the name of the agent from the other. Each of the other two tables contains multiple emails that need to propagate based on the my choice from the other two tables to your plug-in which are not part of the third database table. Can you suggest a set of code to handle this?



Thanks
nmsinc

Re: [nmsinc] Email Plugin

By Djulia - August 31, 2011

Hi nmsinc,

I think that you can use a condition on the name of the tables (line 19) :

if ($tableName == 'table3') { your function mail with request sql and other functions }
if ($tableName == 'table2') { your function mail and other functions }
if ($tableName == 'table1') { your function mail by default }

Djulia

Re: [Djulia] Email Plugin

(Did you mean "bcc" instead of "bbc"?)