Thursday, March 21, 2024

Sitecore Content Hub : Sending emails to a UserGroup - Part 3 : Creating Trigger

Sitecore Content Hub : Sending emails to a UserGroup - Part 3 : Creating Trigger

The Sitecore Content Hub provides you with a trigger framework that allows you to configure triggers using the user interface. A trigger is fired when a specified event occurs under specified conditions. When the trigger fires, it can initiate a set of actions.

Here are the steps outlined for creating the trigger and setting up the conditions on when the trigger will be reacting, and finally setting up what the trigger action will be.
  • Create Triggers:
    • Open the Sitecore Content Hub. On the ribbon, click Manage.

    • Click Triggers, and click New trigger.

    • On the General tab, enter the following values:

      Field

      Value

      Enter a name

      Submit Asset for Review Email Trigger

      Enter a description

      Send emails to Approver User group once Asset is submitted for review

      Objective

      Entity modification

      Execution type

      In background



We need to assess while creating the trigger on what the objective will be: For our use case, we have chosen Entity modification since we want the trigger to reach when any entity is modified.
  • Entity creation - use if you want the trigger to react when any entity is created.
  • Entity modification - use if you want the trigger to react when any entity is modified.
  • Entity deletion: -use if you want the trigger to react when any entity is deleted.
You also need to specify the trigger execution type, which is the method with which the trigger's actions execute. For this use case, we are selecting "in background"
  • In Background: trigger actions execute using an asynchronous background job. With this execution type, trigger actions can only execute during the post phase (that is, after the trigger's event takes place).

  • On the Conditions tab, click Add definition, and in the drop-down list, click Asset (M.Asset). And then add the following definitions:
  • Using the below definitions, we are setting the rule that if the Final lifecycle status of the Asset changes to UnderReview from Created / Archived/ Approved, then the trigger will perform the action mentioned in the next step.
  • On the Actions tab, add the action you created previously (Send Asset Submitted Email).
  • Click Save and close. Confirm to activate the trigger.


No comments:

Post a Comment