Febooti, Ltd.

Turn reports into email notifications

Automation Workshop can easily automate everyday tasks which we can not readily imagine. How about turning text files into automatic email reminders? With Automation Workshop it takes only a few steps to bring life into your data.

Get the Demo task…

Demo Task from this tutorial is available…

Overview

For example, a legacy database automatically exports user subscription information on a weekly basis. The user subscription data is exported in the C:\Input\Files folder to a text file, whose name starts with dump followed by the export date. Each line of the exported file contains a person's name, email address and remaining subscription days, separated by tab character.

Windows Explorer C:\Input\Files · Notepad dump20201027.txt
Database export example · The values are stored in tab-separated columns

Goal

We will email subscription reminders to the users whose membership expiration date is due within a month. This tutorial explains in detail how to setup these steps.

Solution

We will set up the File & Folder Watcher trigger to monitor a folder where the file with user subscription data is exported, in anticipation for a weekly dump file.

  • A For each loop which will process one line of the exported file at a time.
  • The Split text Action to retrieve tab-separated elements (user name, e-mail, and remaining days on subscription) from every line.
  • The If conditional to check the remaining days for each user and, if less than 30, proceed with Send email Action to send a reminder about subscription.

Let's start…

First, let's setup a File & Folder Watcher trigger to monitor C:\Input\Files folder for new files whose name begins with dump. Set folder path, and type dump*.txt in Include mask field, so that no other files will trigger this Task · Learn file mask usage

Folder watcher monitor C:\Input\Files for new dump*.txt files
Folder to watch · C:\Input\Files

Task & Actions

After the File & Folder Watcher trigger is set to monitor for files with subscription data, let's setup the Actions for the Task.

Remaining days notification Properties
Action tab of fully configured Task

Notice the indent for the Split Text and If actions relative to the For Each action. That means that in every step of For Each loop, i.e., every time the For Each action retrieves a line from text file, indented Actions are performed as well. For Each loop will run as many steps as necessary to process every line in text file.

Likewise, the indentation of Send Email action (relative to If action) indicates that it is subordinate to condition specified in If action, rather than performed independently. Only when the condition in If action is met (i.e., the number of remaining subscription days for a particular user is less than 30), the email reminder will be sent.

The information among Actions is passed by Variable Wizard—see underlined elements in the Action tab and green, bold text in parameter fields of all Actions.

Read file

Let's use Read from file Action to read contents of the monitored file as soon as the File & Folder Watcher trigger detects a new dump file in the specified folder.

Dynamically read file content
Read from File · Retrieve file contents

Loop content

Now, let's use For Each loop to process file contents line by line. Set the For Each action to separate File content (using Variable Wizard & Read from file variable) into lines by using Line break separator.

Loop file content line by line
Separate file content into lines

In For Each options specify to ignore empty lines and lines starting with # character (in this example, the header row).

Ignore empty lines, and Ignore lines starting with #
Ignore empty lines when processing text file

Split & tokenize values

Now let's configure Split text Action to get the current item (in our case—the line) in every step of For Each loop (using Variable Wizard & For each variable). Set the tab separator character that delimits data columns in the text file.

Separate line items with a Tab into tokens
Tokenize text lines into elements based on separator character

To design clearer Task, let's assign custom token names to each element, so that the first text element in the line is denoted user, the second—email address and the third—remaining subscription days. These custom names will now be available in Variable Wizard (otherwise, the Variable Wizard will return generic names like Token 1, Token 2 and so on).

Use custom token names
Assign custom variable names for easier recognition

From now on the new variables will be available via Variable Wizard & Split text variables. User variable is assigned to the text in first column, Email to the second column, and Days to the third column.

Compare

When the lines are separated into tokens, we will check each entry for remaining days of subscription. Let's compare if the Days variable is less than 30.

Compare if Days is less than 30
Verify condition for subordinate Action

Notify

Finally, let's add subordinate Send email Action which will notify user of subscription expiration. Note how custom variables are elegantly merged in the email's TO, Subject, and Email text fields.

Send email reminder using mail merge
Mail merge automatic individual email reminder based on data

Done!

Summary

The tutorial shows how to turn simple text file report into automatic e-mail reminders. The Task monitors for reports, processes them line by line while separating text strings into structured elements of data, analyses the remaining subscription and sends a reminder email, if need one.

Remaining days notification Properties
Task complete · From text file to automatic emails

The complete Task will consist of 1 Trigger and 5 Actions. Some Actions are subordinate to others (see indentation). The data is passed through the Task's multiple steps by using Variable Wizard.

Need assistance?

If you have any questions, please do not hesitate to contact our support team.

1,383,699
We're growing fast. Thank you!

Video · Monitor an FTP server & send invoice via email

Automate awesome!
Recent news
  • May 4, 2020
    Command Line Email v7.0 introduces new TLS commands. Improved console output and debugging experience. More improvements.
  • April 16, 2020
    Automation Workshop v4.1.1 ensures even more compatibility with various Windows Domain and network configurations.
  • April 2, 2020
    Automation Workshop v4.1.0 introduces Action favorites and extended view mode. Many minor UX and performance improvements.
My productivity has increased beyond any expectations, and I am happy with the no-time investment in Automation Workshop.—Roland K.
Our clients
Last updated: May 4, 2020
Oct 29, 2020 · 06:54
0.006 · 0.000
0.3 · 3.8