Back

How to Send Conditional Email Messages in SmartConnect

Published: Nov 04, 2024
Post Author Written by Trey Dew

If something in your data source has a peculiar value, or when a certain item is processed, you might want to send a conditional success email.

To set this up, we will need to have a calculation that checks every line of data for a certain value. If that certain value is found, we can update a global variable, which we can then pass into an Email Task. This will be the basic premise of how to set this up.

If you would rather watch a video tutorial, click here.

In this example, I have an integration that has 5 records with various names, and I want to add a field to the email when the name Ashley or Chris is processed – in addition to my normal Post Integration Success Email.

  1. To set this up, we need to go into the tasks on the integration and add a Run Script task under “Tasks that run if the document succeeds”.
    conditional
  2. In the Script Window, you can set up the Logic to compare a Source Column to whatever value you need to. Once that condition is met, you can set a Global Variable to a string value of whatever you like to show up in the email later. Here is how I set it up for my example.
    conditional2
  3. Create a Send Email task under “Tasks that run if the document succeeds” that uses that Global Variable. I have a simple example here:
    conditional3
    The results look like this
    conditional4
  4. Finally, you will want to set up a task that clears the Global Variable before you use it in the integration. Create a Run Script task under “Tasks that run before the Integration”. Set the Global Variable to an empty string.
    conditional5

With all of this setup, you can now send conditional Messages with email tasks.

Have questions about using Conditional Messages in email tasks or other solutions? Feel free to send us an email at support@eonesolutions.com

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.