Funnel action that sends an email to a lead's profile, or another resolved recipient, using content read from a repository file or resolved from an asset query result. The from, reply-to and to addresses can be literal strings, kcode expressions, or values pulled from an asset field. Runs when a lead enters the node via onEnter, and records each sent email against the lead for reporting. Also callable directly, via generateEmail, to send an ad hoc email for a lead outside the normal funnel flow.
Group: Journeys
Extends: AbstractGoalAction
Properties
| Property | Returns | Description |
|---|---|---|
| assetQueryId | String | Id of the asset query used to resolve the content item that the subject, from, reply-to and to values are read from, when those are configured as asset-field values rather than literals. |
| attachments | List<String> | MVEL expressions evaluated against the lead and funnel to resolve the names of lead files to attach to the email. The literal value "*" attaches every file on the lead. |
| contentFileName | String | Path, within the funnel repository, of the HTML file used as the email body. Falls back to a file named after the node id, suffixed "-content.html", when not set. |
| disableTrackingImage | Boolean | Whether the open-tracking image is stripped from the rendered email before sending. |
| from | String | Default from address, or a kcode expression that resolves to one. Used when no asset-field from value is configured, and falls back to the website's email address when neither resolves. |
| fromAssetField | String | Name of the content type field, on the asset resolved by the asset query, that the from address is read from when set. |
| replyTo | String | Default reply-to address, or a kcode expression that resolves to one. Falls back to the resolved from address when neither this nor an asset-field reply-to value resolves to anything. |
| replyToAssetField | String | Name of the content type field, on the asset resolved by the asset query, that the reply-to address is read from when set. |
| subject | String | Default email subject, used when no asset-field subject is configured or resolved, and as the fallback when no multilingual translation is found for the recipient's language. |
| subjectAssetField | String | Name of the content type field, on the asset resolved by the asset query, that the subject is read from when set. |
| to | String | Recipient address, or a kcode expression that resolves to one or more comma-separated addresses. When blank, the email is sent to the lead's own profile instead. |
| toAssetField | String | Name of the content type field, on the asset resolved by the asset query, that the recipient address is read from when set. |
| website | String | Name or id of the website used as the sending context for this email, for example to resolve the default from address and to render website-relative links in the content. |
Methods
getWebsite() · getContentFileName() · getSubject() · getFrom() · getReplyTo() · getTo() · getAttachments() · getDisableTrackingImage() · generateEmail(String from, Lead lead) · getAssetQueryId() · getSubjectAssetField() · getFromAssetField() · getReplyToAssetField() · getToAssetField() · numEmails(FunnelRepository funnelRepo)
getWebsite()
Returns: String
Name or id of the website used as the sending context for this email, for example to resolve the default from address and to render website-relative links in the content.
getContentFileName()
Returns: String
Path, within the funnel repository, of the HTML file used as the email body. Falls back to a file named after the node id, suffixed "-content.html", when not set.
getSubject()
Returns: String
Default email subject, used when no asset-field subject is configured or resolved, and as the fallback when no multilingual translation is found for the recipient's language.
getFrom()
Returns: String
Default from address, or a kcode expression that resolves to one. Used when no asset-field from value is configured, and falls back to the website's email address when neither resolves.
getReplyTo()
Returns: String
Default reply-to address, or a kcode expression that resolves to one. Falls back to the resolved from address when neither this nor an asset-field reply-to value resolves to anything.
getTo()
Returns: String
Recipient address, or a kcode expression that resolves to one or more comma-separated addresses. When blank, the email is sent to the lead's own profile instead.
getAttachments()
Returns: List<String>
MVEL expressions evaluated against the lead and funnel to resolve the names of lead files to attach to the email. The literal value "*" attaches every file on the lead.
getDisableTrackingImage()
Returns: Boolean
Whether the open-tracking image is stripped from the rendered email before sending.
generateEmail(String from, Lead lead)
Returns: EmailItem
Generates and sends an ad hoc email to a lead's profile outside the normal funnel flow, using this action's configured content, subject and reply-to settings. Called directly from GraalJS mapping code.
| Parameter | Description |
|---|---|
from | the from address to send with |
lead | the lead whose profile receives the email |
getAssetQueryId()
Returns: String
Id of the asset query used to resolve the content item that the subject, from, reply-to and to values are read from, when those are configured as asset-field values rather than literals.
getSubjectAssetField()
Returns: String
Name of the content type field, on the asset resolved by the asset query, that the subject is read from when set.
getFromAssetField()
Returns: String
Name of the content type field, on the asset resolved by the asset query, that the from address is read from when set.
getReplyToAssetField()
Returns: String
Name of the content type field, on the asset resolved by the asset query, that the reply-to address is read from when set.
getToAssetField()
Returns: String
Name of the content type field, on the asset resolved by the asset query, that the recipient address is read from when set.
numEmails(FunnelRepository funnelRepo)
Returns: long
Counts the emails that have been sent from this node, across all leads in the given funnel repository. Used by the funnel management page to show a running total per email node.
| Parameter | Description |
|---|---|
funnelRepo | the funnel repository to count sent emails in |