null


Skip to end of banner
Go to start of banner

Sending an email on a state change

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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 each of the following

"triggers": [
  {
    "event":"on-change-state",
    "conditions": [
      {
        "state": "Published"
      }
    ],  
    "actions": [
      {
        "action":"send-email",
        "recipients": [
            "@watchers",
            "@creator",
            "@lastUpdatedBy",
            "@document_user_reviewers@"
        ],
        "notification": {
          	"subject":"${content.title} has been published",
          	"title":"${content.title} is published",
          	"body":"Hello, ${content.link} in the ${content.space} space has approved and is now in the PUBLISHED state"
        }
      },
      {
        "action":"set-message",
        	"type":"info",
        	"title":"Published",
        	"body":"The page has been approved and published",
        	"tags":"state",
        	"mode":"autoClose"
      }
    ]
  }
]

If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

event

"on-change-state"

  • trigger listens for a state change event

  • condition added for change of workflow state to named state

condition

"state": "Published"

  • state condition for the trigger event

action

"send-email"

  • email sent to users who are added as values for the workflow parameter @document_user_reviewers@

action

"set-message"

  • on-screen info type message notification when viewing the content stating content has bene approved and published that will auto close after 10s

Screenshot 2024-01-29 at 16.26.06.png

0

  • No labels