It's fairly easy to send an e-mail with the Automation Engine once a workflow has finished running: all it takes is a
CALL object and a few adjustments.
We'll see the method is slightly different depending on whether it ended successfully or not.
1 - Creating the notification
Pre-requisite : make sure 'SMTP_' keys have been set in
UC_CLIENT_SETTINGS and that the SMTP connection works.
https://us.v-cdn.net/5019921/uploads/editor/tp/prrhczbli7ub.png" width="243">
- Define one or several recipients:
https://us.v-cdn.net/5019921/uploads/editor/ef/m2nisrgotl5v.png" width="366">
- By default the mail triggered by the CALL object will contain the object's report as an attachment:
https://us.v-cdn.net/5019921/uploads/editor/9n/912qbc0cy477.png" width="427">
2 - Triggering the notification
A - when the execution was unsuccessful- Edit the workflow and make sure the'Runtime'tab is visible:
https://us.v-cdn.net/5019921/uploads/editor/vr/savrs93thayj.png" width="419">
- Then from the Runtime tab, check the 'Else execute' box and hit the "..." button
to choose the notification object:
B - When the execution was successful
In this example we want the workflow to shoot an e-mail when it ends OK. It is a bit more complex, and can be achieved by nesting the workflow into a parent workflow.
- Create a standard workflow:
- Drag and drop the "child" workflow into the newly created "parent" workflow. Make sure to add connections with the line tool.
- Then click on the box at the right end of the child workflow block to open itsproperties.
- Then go to 'Postconditions' tab:
https://us.v-cdn.net/5019921/uploads/editor/yl/morsrf9h2ds6.png" width="415">
- Drag and drop 'Status' from the conditions column:
https://us.v-cdn.net/5019921/uploads/editor/8k/j56hhx8uinio.png" width="445">
- Select'ANY_OK' from the drop-down list:
https://us.v-cdn.net/5019921/uploads/editor/dw/r8t4l0xfv64a.png" width="246">
- Drag and drop 'EXECUTE OBJECT' from the 'Actions' column:
https://us.v-cdn.net/5019921/uploads/editor/lg/plmysetzo93s.png" width="1066">
- Set the object name and choose 'do not wait' then press OK.
https://us.v-cdn.net/5019921/uploads/editor/ic/ajocttkpor5h.png" width="292">
Done!