send-email trigger action
Overview
Using the send-email action in a workflow trigger lets you send customized emails. The trigger action sends a custom email when a chosen workflow event occurs, such as a change of workflow state or the expiration of a state due date.
You must add at least one value as a recipient to the custom email. This must be at least one value from any of the following:
email address of a recipient
Confluence user
Confluence user group
Confluence smart value such as watchers of the page, the page creator, the last user who edited the page
a workflow user parameter or group parameter
When the workflow trigger event occurs, the trigger checks that any required conditions are met, and if met, the "send-email"
action sends an email to the specified recipients.
"send-email"
The trigger action "send-email"
sends a custom email to one or more specified recipients.
action (send-email)
recipients (array) ❗️Recipients to send the email to (at least one recipient value must be added). A comma-separated list of one or more recipients is added using a combination of:
one or more
email
addressesone or more users using
{"user"="userID"}
specifying the AtlassianuserID
.†one or more user groups
{"group":"groupID"}
specifying AtlassiangroupID
‡ or the AtlassiangroupName
‡one or more user type workflow parameters using
@userTypeParameterName@
(see workflow parameter references)one or more group type workflow parameters using
@groupTypeParameterName@
(see workflow parameter references)One or more of the following Confluence
value references
@watchers
(set at document level only)@lastUpdatedBy
@creator
notification (object) ❗️ Notification holder. This includes the following parameters as a comma-separated list within curly brackets:
"title"
(optional)"subject"
❗️"body"
❗️
❗️Mandatory parameters
recipients
At least one value for recipients must be included
notification
The "notification" holder is required. This must include both
"subject"
"body"
† Each Confluence user must be specified individually using {"user":"userID"}
. Add multiple Confluence users in a comma-separated list {"user":"userID_One"},{"user":"userID_Two"}, ...
‡ Each Confluence group must be specified individually using {"group":"groupID"}
and/or {"group":"groupName"}
. Add multiple Confluence groups in a comma-separated list {"group":"groupID_One"},{"group":"groupID_Two"},{"group":"groupName_Users1"},{"group":"groupName_Users2"}, ...
You can embed any of the following as part of the text value in the "title"
, "subject"
, and "body"
parameters
${content.title}
- inserts the name of the page or blog post${content.link}
- inserts the link of the page or blog post${content.space}
- inserts the name of the space
Example trigger code
"triggers":
[
{"event": "on-change-state",
"conditions":
[
{"state": "Review"}
],
"actions":
[
{"action": "send-email",
"recipients":
[
"@creator",
"@watchers",
"@lastUpdatedBy",
"@user_type_parameter_1@",
"@user_type_parameter_2@",
"@group_type_parameter_1@",
"@group_type_parameter_2@",
"email_1@email.com",
"email_2@email.com",
{"user": "user_ID_1"},
{"user": "user_ID_2"},
{"group": "group_ID_1"},
{"group": "group_ID_2"},
{"group": "group_Name_1"},
{"group": "group_Name_2"}
],
"notification":
{"subject": "${content.title} is In Review State",
"title": "${content.title} is In Review State",
"body": "Hello, ${content.link} in the ${content.space} space is in review state."
}
}
]
}
]
On-screen notification messages can be created using the "set-message"
trigger action.
Workflow trigger-generated email 'failure to send' errors are included in the Confluence log.