Step 8: Team B gives final approval and sends email to initiator

In this step we configure the Approved branch of the Assign a task action in the Team B state. When the reviewer in Team B approves the document, an email is sent to the initiator of the workflow (the user that uploaded the document to the document library) and exits the review process.

This is the last action we add to the workflow

1

Add a 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 Approved branch for Team B 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

Let's configure the Send an email action to send an email to the initiator of the workflow.

  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. Do the following:

    1. Click and in the Equals section that appears select Workflow Context in the first drop-down.
    2. Expand the second drop-down 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 document receives final approval.
    3. Click Insert.

    [%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 Final approval for ‍{Current Item:Name}‍ document.
  3. Note: 

    ‍‍{Current Item:Name} is a variable you can insert from the Insert Reference pane. When the email is sent the variable will be replaced with the name of the document uploaded.

    For example, if a document name is Review, the subject of the email sent will be "Final approval for Review document"

    To insert a variable from the Insert References pane,:

    1. In the email body click where you want to insert the reference. The Insert Reference pane is displayed on the right.
    2. Expand the relevant section and double click on a reference to insert it.
  1. In the Body field add a message to inform the initiator that the document has received final approval.
  2. Click Save to save the configuration.

3

Exit State machine

After the final approval is given the workflow exits the State machine and the review process.

  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 in Team C 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.

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

Follow along

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

Next step:

Step 9: Configure start options