Email Alerts to multiples emails based on users profile

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
casike
User
Posts: 2

Email Alerts to multiples emails based on users profile

Post by casike »

I have been using PHPMaker for many years now , early 2000 , i have done many web interface , for companies i worked for.. it is amazing application, options are endless. i would like a way to alert on multiples emails, example , if a user entered new data (like a Request) based on users table and email assign to the user the system can sent emails alerts to specific individual based on the users table data.. i did a maintenance request web interface seems to be working but we have to send the email manually once the ticket is close. it will be nice if some how the system allows multiples alerts based on users profiles..

Thank you


kirondedshem
User
Posts: 642

Post by kirondedshem »

If you need a quick way out
Ive done something similar where I set the emails to notify on a particular custom api operaions
as long as there is a event fired for when the desired activity is done, ie ticket is closed, row_updated or custom row action, and there is a setting to indicate which emails should notified then I think you can loop through these and use $newmail = new cEmail; to create and send emails to a list of addresses as well as customize the email content etc


mobhar
User
Posts: 11660

Post by mobhar »

The closest approach for this is by using "Email_Sending" server event. You may simply assign the "Recipient" property of "Email" object in that event with the list of email in comma separated values format. For example:

if (CurrentPageID() == "add") { // If Add page
$sEmail_List = "abc@example.com,def@example.com,ghi@example.com"; // <-- you may populate this list from Database; adjust to your needs
$Email->Recipient = $sEmail_List;
...
}

Please read "Server Events and Client Scripts" topic from PHPMaker Help menu, and see "Email_Sending" section.


vintoICT
User
Posts: 389

Post by vintoICT »

Will this work for grid add or edit as well?
I know the if statement must be changed


arbei
User
Posts: 9284

Post by arbei »

Yes, it should. Email_Sending event is common for the table.


mobhar
User
Posts: 11660

Post by mobhar »

vintoICT wrote:

Will this work for grid add or edit as well?

Yes, it will. For Grid-Add and/or Grid/Edit mode, then you may add the condition check as follows:

if ($this->isGridAdd() || $this->isGridEdit()) {
// ...
}


Post Reply