Workflows

How to send emails and text messages from a workflow

How to send emails and text messages from a workflow

In a TeleportHQ workflow, you send an email with a Send Email step and a text message with a Send SMS step. Each step works with a sending service you have an account with, such as SendGrid for email or Twilio for SMS. Add the step, paste your service's API key, then fill in who it's from, who it's to and the message. You can use data from earlier steps, for example the email address someone typed into your form.

Before you start

  • A web app. Workflows are a web app feature. On a website, creating a workflow first asks you to enable web app features. See What are workflows?.
  • A sending service account. TeleportHQ workflows send through your own account with one of these services:
    • Email: SendGrid, Mailgun, Mailersend, Postmark or Resend.
    • SMS: Twilio, TextMagic, Infobip or SMSAPI.
  • A verified sender. Most services only send from an email address, domain or phone number you have verified with them.
  • A workflow with a trigger, for example Form is Submitted for your contact form. See How to create a workflow.

Steps: send an email

This example emails a bakery owner each time someone sends the Order cake form.

  1. Open the workflow. Click the round + (Add node) under the step after which the email should go.
  2. Point at Email and click your service, for example Send Email (SendGrid).
  3. In the right panel, paste your key into the credential field, for example API Key for SendGrid. Mailgun also needs a Domain; Postmark asks for a Server Token. The key is stored as a project secret, and the field's description links to the page of your service where you find the key.
  4. Fill in the message:
    • From Email: orders@mybakery.com
    • From Name: My Bakery
    • To: owner@mybakery.com
    • Subject: New cake order
    • Reply To: drag the form's email value from the Context panel, so you can reply straight to the customer. See How to use data from one workflow step in the next.
  5. Choose how to write the body, with the two tabs above it:
    • Raw content: type the message in the text editor. Click Insert Variable in its toolbar to add values such as the customer's name.
    • Email template component: pick a designed email under Email template ("Select a template…"). Under Template parameters, click Add Parameter and fill each {{name}} placeholder the template uses. Click Edit template to change its design.
  6. Optional: set CC, BCC and Email Type (Transactional or Marketing).
  7. Click Test Email Integration to check your key and sender. In the window, type an address under Send to, then click Send Test Email. A real email is sent, and the live logs show what happened.
A TeleportHQ Send Email step with its key, From Email, To and Subject fields, and the Test Email Integration button highlighted

Steps: send a text message

This example texts a customer when their order is ready.

  1. Click the round + (Add node) under a step.
  2. Point at SMS and click your service, for example Send SMS (Twilio).
  3. Enter the credentials, for example Account SID and Auth Token for Twilio (TextMagic: Username and API Key; Infobip: Base URL and API Key; SMSAPI: Access Token).
  4. From: the sender number registered with your SMS service, for example +15550100.
  5. To: the recipient in international format, for example +447700900123. You can take it from an earlier step.
  6. Message: type the text, for example Your cake is ready for pickup!. To add a value from an earlier step, click Add value to concatenate and put the value in the new part. The parts are joined in order.

One provider for the whole project

The first email service you set up becomes your TeleportHQ project's email provider. When you enter a key in a Send Email step and the project has no email provider yet, TeleportHQ makes that service the project's provider, and switches the other email steps that have no key yet to that service, with your key. The project's email provider also sends your site's account emails and store notifications.

To see which provider your project uses, or to switch every email or SMS step to another one, click the Project settings cog at the bottom of the left sidebar, then Credentials → Email Providers or SMS Providers, and click Use for this project on the provider you want. See How to choose which email and SMS provider your project sends through.

Check that it worked

  • Test the step: click it, then click Test in the right panel and Run test. A real email or SMS is sent. See How to test a workflow step.
  • After you publish, run the workflow on your live site, for example by sending the form, and check the inbox or phone.
  • If your web app has the admin panel, its Sent Emails page lists the emails your site sent, workflow emails included.

Troubleshooting

The yellow issues chip at the top left of the editor counts a missing setting, and the step has an orange warning The service's key or sender details are missing. Click the chip and fill them in under Missing Credentials, or fill in the step's fields. See What do the warnings at the top of the editor mean? and Why does my workflow show missing configuration or security warnings?.

Test Email Integration is greyed out: "Resolve the following to enable testing:" Point at the button to see what's missing, such as the key or From Email, and fill it in. A From Email taken from an earlier step can't be tested here: type an address while you test. Only the project owner and workspace Admins see this button.

"No email templates yet. Create one from the components panel…" There are no email template components in the project yet. Use Raw content, or create an email template component first.

The test works but no email arrives Check your spam folder, then check that From Email is a sender verified with your email service.

The SMS fails with an invalid number error Use international format with a + and country code for To, and make sure From is registered with your SMS service.

Good to know

Share

Related Articles

What are workflows?

A workflow in TeleportHQ is a visual recipe that makes your web app do something, one trigger (like a button click or a form submission) followed by steps (like saving to a database, sending an email or opening a page), built without writing code; adding one makes a website a web app.

How to use data from one workflow step in the next

In a TeleportHQ workflow, every step can use the results of the trigger and earlier steps (the workflow Context), by dragging a value from the Context panel onto a field or picking it with the Select from context button.

How to test a workflow step

In TeleportHQ, click a workflow step and click Test in the right panel (or right-click the step and choose Test this node…), fill in sample values for the data it needs, then click Run test to run that one step for real and see its output; the Test runs tab lists every test of the workflow.

How to choose which email and SMS provider your project sends through

In the TeleportHQ editor, click the Project settings cog, open Credentials → Email Providers or SMS Providers to see which provider your project sends through and where it's used, add a provider's credentials, and click Use for this project to switch every workflow step to it.

How to customize welcome and password-reset emails

In TeleportHQ, the welcome, password reset and account deletion emails are the components welcome, password-reset and account-deletion in the Components list's email-templates → customer folder, which you design like any component; they're sent through your project's email provider (SendGrid, Mailgun, MailerSend, Postmark or Resend), set in Project settings → Credentials → Email Providers.

Why does my workflow show missing configuration or security warnings?

TeleportHQ shows a yellow "N issues" button at the top left of the editor when workflow steps still need keys, pages, elements or states (it opens the Issues window), a "N security issues" button when workflow code could leak secrets or run unsafe SQL (critical ones block publishing), and a "Not exported" badge on a workflow that can never run; each one leads you to the step to fix.