Sending an email to @document_user_reviewers@
when the page reaches the named state Published
In this example, the trigger listens for the change of state event to the state named Published.
The action sends an email to the users who have been added as values for the workflow parameter @document_user_reviewers@
.
[ { "event":"on-expire", "actions":[ { "action":"send-email", "recipients":[ "@watchers", "@creator", "@lastUpdatedBy" ], "notification":{ "subject":"${content.title} has expired", "title":"${content.title} has expired", "body":"Hello, ${content.link} in the ${content.space} space has expired and needs to be reviewed" } }, { "action":"set-message", "type":"info", "title":"Expired", "body":"The page has expired", "tags":"state", "mode":"autoClose" } ] } ]
event | on-change-state |
|
---|---|---|
condition | state:Published |
|
action | send-email |
|
action | set-message |
|
0
An alternative is to use the final:true
condition for the on-change-state
event if you have the Published state configured as the workflow final state.
It is mandatory in the
send-email
trigger action to add at least one recipient and includenotification
withsubject
andbody
valuesset-message
trigger action to add the messagetype
andbody
values
A range of JSON trigger actions is available including the clean-message
action to remove all on-screen notifications.
List of trigger actions
- change-state trigger action
- approve trigger action
- reject trigger action
- unassign trigger action
- clean-messages trigger action
- remove-restrictions trigger action
- publish-page trigger action
- set-expiration trigger action
- clear-expiration trigger action
- send-email trigger action
- assign trigger action
- set-message trigger action