Page History
Info | ||||
---|---|---|---|---|
| ||||
AQ_MailService is used to send e-mails using Assets. This Asset is used as body text that can in turn (optionally) contain HTML tags. |
Parameters
Name | Description | Type | Required |
---|---|---|---|
addresses-to-expr | An expression which results in an email address or list of addresses. The text format must adhere to the RFC822 standard. See also the Tips section below. | String | Yes |
addresses-cc-expr | An expression which results in an email address or list of addresses. The text format must adhere to the RFC822 standard. | String | No |
addresses-bcc-expr | An expression which results in an email address or list of addresses. The text format must adhere to the RFC822 standard | String | No |
address-from | An expression which results in an email address. The text format must adhere to the RFC822 standard | String | Yes |
addresses-reply-to-expr | An expression which results in an email address or list of addresses. The text format must adhere to the RFC822 standard. Since Blueriq 17.7 | String | No |
mail-asset | The name of the asset that contains the subject and the body of the email. Note: The type of the asset must be “Email” and should contain only one line of text. | String | Yes |
smtp-host | The hostname of the SMTP server. | String | No |
smtp-port | The port of the SMTP server. | Integer | No (defaults to 25) |
smtp-user | The username to use when connecting to the SMTP server. | String | No |
smtp-password | The password to use when connecting to the SMTP server. | String | No |
smtp-usetls | Indicates if the SMTP server should be contacted using TLS (Transport Layer Security). | Boolean | No (defaults to false) |
Documents | Specify all documents to be generated and attached. (deprecated, use connection instead) | Document | No |
Connection | Specify the connection. It is used for document attachments | String | No |
FileIds | Specify one or more file ids. When using this parameter, you also need to use the Connection parameter. | Expression | No |
Events
- MailSizeExceeded: When the mail server indicates the combined size of all attachments is too large to be send, this exit is taken so that you can give a clear indication to the end user. If the max size is exceeded and this exit event is not mapped, an error is thrown.
Tip | ||||||||
---|---|---|---|---|---|---|---|---|
When specifying email address values in the parameters above, expression statements are to be used. For a simple hard coded email address, an expression containing a constant value suffices:
The parameters addresses-to-expr, addresses-cc-expr or addresses-bcc-expr can deal with a list of values. In that case, the expression should reflect this:
Using the expression, addresses can be retrieved:
The AQ_MailService supports adding phrases to mail addresses (where the 'phrase' typically is a for humans readable identifier of the mail address. The format for an email address using a phrase is: Typically, phrases can be surrounded by the double-quote character (
|
Properties
Some AQ_MailService parameters can be set in the
Include Page | ||||
---|---|---|---|---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq.connection.[AQ_MailService name from Encore].email.smtp=exampleDomain.com (for the smtp-host parameter)
blueriq.connection.[AQ_MailService name from Encore].email.smtpport=25 (for the smtp-port parameter)
blueriq.connection.[AQ_MailService name from Encore].email.username=userName (for the smtp-user parameter)
blueriq.connection.[AQ_MailService name from Encore].email.password=password (for the smtp-password parameter)
blueriq.connection.[AQ_MailService name from Encore].email.usetls=true (for the use-tls parameter)
blueriq.connection.[AQ_MailService name from Encore].email.fromaddress=test@yourDomain.com (for the address-from parameter)
# repytoaddresses is available since Blueriq 17.7
blueriq.connection.[AQ_MailService name from Encore].email.replytoaddresses=reply-to@example.com (for the addresses-reply-to-expr parameter)
blueriq.connection.[AQ_MailService name from Encore].email.toaddresses=test1@example.com (for the addresses-to-expr parameter)
blueriq.connection.[AQ_MailService name from Encore].email.ccaddresses=test2@example.com (for the addresses-cc-expr parameter)
blueriq.connection.[AQ_MailService name from Encore].email.bccaddresses=test3@example.com (for the addresses-bcc-expr parameter) |
Default mail connection properties
When a AQ_MailService connection name is not defined in the properties, the runtime will fall back on the defined default property. The default properties can be defined as shown in the following example. When a specific property for an AQ_MailService is not defined, it will fall back on the default properties. If no default properties are set, it will fall back on the Encore parameters.
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq.connection.email.smtp=exampleDefaultDomain.com (for the smtp-host parameter)
blueriq.connection.email.smtpport=25 (for the smtp-port parameter)
blueriq.connection.email.username=defaultUserName (for the smtp-user parameter)
blueriq.connection.email.password=defaultPassword (for the smtp-password parameter)
blueriq.connection.email.usetls=true (for the use-tls parameter)
blueriq.connection.email.fromaddress=default@yourDomain.com (for the address-from parameter)
# repytoaddresses is available since Blueriq 17.7
blueriq.connection.email.replytoaddresses=reply-to@example.com (for the addresses-reply-to-expr parameter)
blueriq.connection.email.toaddresses=default1@example.com (for the addresses-to-expr parameter)
blueriq.connection.email.ccaddresses=default2@example.com (for the addresses-cc-expr parameter)
blueriq.connection.email.bccaddresses=default3@example.com (for the addresses-bcc-expr parameter) |
Tip | ||
---|---|---|
When the e-mail addresses are configured through the property files, it's not possible to use expressions or any Blueriq logic to derive them from attributes (use Encore configuration instead). Also note the following points:
E-mail addresses configured in properties may contain the following formats:
|
...
Note |
---|
It is not recommended to specify the password in Encore because the value of the smtp-password parameter is saved in plain text in the project xml which can lead to security issues. We recommend saving the password in the |
Tip |
---|
When you want to send an email from a different address or alias, then you need to configure that on the mail service. Here is the documentation on how to do that for gmailGmail: https://support.google.com/a/answer/22370?hl=en When this is not set correctly, you will experience that the mail send from the mail address that is configured for authentication with TLS. |
...