Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#824462
Dear Experts
At the moment, I send email for a special group according to the wiki trigger examples. However this is not ideal for my goal, because users have to change the users of a special group in every time.
It is better to be sent email from grid information.
In my grid, I connected a field of grid to database which gets the user names from database. In this way, user can select his /her intended users. After that, PM must send email for all of users who are selected by him/her in order to be attended in a meeting. For example, if he/she selects individual A and B, PM must send email for A and B. or if he/she chooses A,B and C, PM must send email for A,B and C.
How can I do that?
I was wondering if you could support me to solve it.
Looking forward to your comments
Kind Regards
Attachments
email.jpg
email.jpg (41.61 KiB) Viewed 47 times
#824471
Your trigger code would be something like this:
Code: Select all
$to = '';
foreach (@=recipientsGrid as $aRow) {
    if (!empty($aRow['emailTo'])) {
        $to .= (empty($to) ? '' : ', ') . $aRow['emailTo'];
    }
}
PMFSendMessage(@@APPLICATION, $from, $to, '', '', 'email subject', 'emailTemplate.html');
Where "recipientsGrid" is your grid's variable and "emailTo" is the ID of the dropdown in the grid to select the user to receive the email.

The SQL of this dropdown should be:
SELECT USR_EMAIL, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME) FROM USERS
Warning SMTP Error: Data not accepted

warn.PNG Getting this warning and I dont know w[…]

Grid dropdown

Is there a way to check selected option(dropdown g[…]

Timezone issue

Hi, the problem is that when I insert the data to […]

Hi, I set permission PM_EDITPERSONALINFO for oper[…]