Part 1 · Email · Sending mail from a Flow
Get an App Password from Google, then configure Email Initialise and Email Send to send notification mail out of a Flow.
A Flow can send an email notification when it detects a condition that requires attention. NARA provides two Nodes for this task. Email Initialise configures the sender account, and Email Send creates and sends the message.
This Workshop uses a Google account. You can change the configuration later to use another email provider.
1. Getting an App Password from Google
Google no longer lets external programs sign in with your account password directly, so we need an App Password instead: a 16-digit code issued for one specific app.
The steps, roughly:
- Turn on 2-Step Verification for the Google account first. Without it, the App Passwords menu doesn't appear at all.
- Go to your Google Account and open the Security tab.
- Under 2-Step Verification, look for App passwords, or go straight to myaccount.google.com/apppasswords.
- Give it a name you'll recognise later, such as
NARA, and press Create. - Google displays a 16-digit code. Copy the code for use in the next step.
Save the App Password before closing the window
Google displays the App Password only when it is created. Copy it before closing the window because it cannot be viewed again. If the code is lost, delete the existing App Password and create a new one. Changing the Google account password also revokes existing App Passwords, so you must create a new code afterward.
For the full details, see Google's help page on Sign in with app passwords.
2. Configuring the Email Initialise Node
Drop an Email Initialise Node into the Flow. Nothing needs to be wired into it, because it's an Independent Node that just holds the settings. Configure it once and several Email Send Nodes can share it.
| Field | What goes in it |
|---|---|
| Sender Email Address | The sender's address, meaning the Google account you created the App Password for |
| Password | The 16-digit code from the previous step, not your account login password |
| Email Provider | Pick Google and the SMTP settings are filled in for you. Pick Other and you'll need to enter the SMTP Server and SMTP Port yourself (commonly 587 for TLS and 465 for SSL) |
| Maximum Emails per Second | Caps how many emails go out per second, which keeps you from looking like a spammer. A small number is fine for testing |
| Max Emails in Queue | How many emails can wait in the queue. When it's full, the oldest one is dropped |
All of this can be changed later. Moving to a company mailbox is just a matter of switching Provider to Other and filling in your workplace SMTP details.
3. Configuring the Email Send Node
Next, place an Email Send Node and wire the previous Node into it, since this one only runs when a signal reaches it.
| Field | What goes in it |
|---|---|
| Setup Tool | Points back at the Email Initialise Node you configured. Required, nothing sends without it |
| To | The destination address. Separate multiple recipients with ;, as in a@gmail.com;b@gmail.com |
| CC / BCC | Copy and blind copy. Optional |
| Subject | The email subject line |
| Body | The email content |
To, Subject, and Body all support {{}} Template Expressions, so values from earlier Nodes can be dropped straight in:
Subject: Alert: person detected in the danger zone
Body: Detected {{count}} people in the zone at {{timestamp}}To send different messages to different groups, place several Email Send Nodes and point them all back at the same Email Initialise. There's no need to set up the account again.
4. Trying it out
Deploy and let the Flow run through the Email Send Node. If everything is set up right, the email lands in the destination inbox within seconds. If it doesn't, work through these:
| Symptom | Likely cause |
|---|---|
| An authentication error | The Google account password was used instead of the 16-digit App Password |
| App Passwords can't be found in the Google settings | 2-Step Verification isn't turned on |
| It used to work and suddenly stopped | The Google account password was changed, which revoked the old App Password. Create a new one |
| The Flow runs but no email goes out | Email Send has no Setup Tool selected, or no signal is reaching the Node |
| The email lands in Junk | Normal for mail sent from a program. Check the Spam folder first |
Next
Mail can go out of a Flow now. Part 2 covers the other direction, a two-way conversation with an external system, at Part 2 · HTTP Connection · Talking to an external system.
IO · Connecting to external systems
Learn how to send email notifications and exchange data with external systems over HTTP.
Part 2 · HTTP Connection · Connecting to an external system
Use HTTP Client, HTTP Request Polling Trigger, and HTTP Client Request to retrieve data from an external server and display it on the Dashboard using a Postman Mock Server.