Page 1 of 1

Email Alerts to multiples emails based on users profile

Posted: Mon Oct 23, 2017 9:02 pm
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


Re: Email Alerts to multiples emails based on users profile

Posted: Thu Oct 26, 2017 1:25 pm
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


Re: Email Alerts to multiples emails based on users profile

Posted: Thu Oct 26, 2017 2:14 pm
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.


Re: Email Alerts to multiples emails based on users profile

Posted: Tue Jun 01, 2021 5:25 am
by vintoICT

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


Re: Email Alerts to multiples emails based on users profile

Posted: Tue Jun 01, 2021 9:10 am
by arbei

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


Re: Email Alerts to multiples emails based on users profile

Posted: Tue Jun 01, 2021 9:44 am
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()) {
// ...
}