Step 5: Team A rejects document and sends email to initiator

If the Team A reviewer decides that the document needs more work, they can reject the task. In this step we will look at how to configure the Rejected branch of the Assign a task action in Team A state to send an email to the initiator and exit the state machine.

When the initiator has a new document version ready for review, they'll upload it to the Document library again and a new review process begins.

1

Add the Send an email action

  1. Click the User Interaction category in the action toolbox, select the Send an email action and drag it to the Rejected branch of Team A state.
  2. Do one of the following to open the Action configuration window.

    • Double-click the action.
    • Click on the action and then click Configure.

2

Configure the Send an email action to send an email to the initiator

  1. Add the recipient of the email in the To field. The recipient for this email is the workflow initiator that uploads the document to the Document library so we add the Initiator Context variable. [%Workflow Context:InitiatorUserId%] inserts the initiator of the workflow. The workflow initiator is the user that adds the document to the Document library

    Do the following:

    1. Click and in the Equals section that is displayed, select Workflow Context from the Equals drop-down list.
    2. Expand the second drop-down list and select Initiator. The Initiator is the user that uploaded the document and started the workflow. An email is sent to the initiator when the first reviewer rejects the task.
    3. Click Insert.
    4. [%Workflow Context:InitiatorUserId%] displays in the To field.

    Note: If you add an external email address in the To field, you have to select the External email and attachment option in the Email service field.

  2. In the Subject field type The document has been rejected.
  3. In the Body field add a message to inform the initiator that the document is rejected. You can use the Current item name from the Insert Recurrences pane to indicate the name of the item that is rejected.
  4. Click Save to save the configuration.

For more information about the Send an email action and the configuration, see Send an email.

3

Exit state machine

After rejecting the document the workflow can be set to exit the state machine and the review process to end the workflow.

  1. Click the Logic and Flow category in the action toolbox, select the Set next state action and drag it under the Send an email action.
  2. Do one of the following to open the Action configuration window.

    • Double-click the action.
    • Click on the action and then click Configure.

  1. Open the Set next state drop-down and select Exit state machine from the list.
  2. Click Save.

Follow along

This is what your workflow looks like at this point in the solution:

Next step:

Step 6: Assign a task to Team B to review document