Send E-mail (Multiple)v5
The Send E-Mail Multiple action sends emails based on the data contained in a Grid control. Emails can be grouped and sent to different recipients according to the values in a selected Grid column.
Send E-Mail Multiple Action in the Toolbox
Properties
Group Fields: Groups Grid records by the selected field and sends one email for each group.
Description: Enter a description for the action.
Heading: Specifies the name displayed in the Actions list when the action is added as a form action.
File Format: Specifies the format of the attachment sent with the email (for example, PDF, XLS, etc.).
Design File: Specifies the file name of the generated attachment or an SQL query that returns the file name.
To Whom: Specifies the recipient email address. The value can be entered directly or retrieved dynamically using an SQL query.
Information (CC): Specifies additional recipients who should receive a copy of the email. The value can be entered directly or retrieved using an SQL query.
Subject: Specifies the email subject. The value can be entered directly or returned by an SQL query.
Sender Mail (1-Mail, 2-Host, 3-Password, 4-Display Name, 5-User Name, 6-SSL, 7-Port): Specifies the SMTP settings of the sender email account.
If this field is left NULL, the default email settings configured in the system parameters are used.
Files to Be Added (File Name, File Content): Allows files attached to the form to be included as email attachments. The files are retrieved using an SQL query.
Content: Specifies the body of the email.
HTML File: Specifies the HTML template used as the email body.
The HTML file must be located under the Uploads\Mail folder in the application's working directory.
Confirmation Form: Specifies the form that opens when the recipient clicks the approval link in the email.
Confirmation ID Field: Specifies the form field where the record ID received from the email link is written.
Confirmation User: Specifies the username used to log in after clicking the approval link.
If this field is left blank, the login screen is displayed.
Confirmation Password: Specifies the password used to log in through the approval link.
Send to Approval: Specifies whether an approval link is included in the email.
Link Text: Specifies the text displayed for the approval link in the email.
Info Mail CC: Determines whether CC recipients receive the email.
Not Information Message: Hides the notification displayed after the email is sent.
Run Condition: If the query entered in this field returns 0, the action will not be executed.
Request Confirmation: Select whether confirmation should be requested before the action is executed. When Request Confirmation is enabled, the Confirmation Message property becomes available, allowing you to specify the message displayed in the confirmation dialog.
Example
Assume that the Client screen contains a Grid control with an Email column.
Grid
Configure the Send E-Mail Multiple action in the After Save event of the form. Set the To Whom field to: $PEmail
When the form is saved, emails are grouped and sent according to the values in the Email column.
For example, if the Grid contains the email addresses:
xxx@xxx.xxyyy@yyy.yy
two separate emails are sent—one to each unique email address.
Client View
Note
Because this action uses the Email field in the Grid, it should be executed in the After Save event.
Note
To prevent duplicate email delivery, records that have already been processed by this action are not sent again. For repeated testing or subsequent email delivery, new records should be created.