We’ve had requests from Ted B. and a few others to expand Zingtree’s ability to send email. Specifically, they needed the ability to send to an email address collected by a data entry form, and customize the body copy. So, we created a Webhook that anyone can use!
Sending email messages can be done in two ways:
- By using a web page URL as a template for HTML formatted messages.
- Or by sending a plan text message, and supplying the body copy.
Sending Messages using an HTML Template
First of all, you need to add a Webhook to your account. Here’s how:
- Go to Account > My Apps and click Add Webhook.
- Give your new webhook a name. Let’s call it “Send Email from demo Template“.
- Add this as the webhook URL:
- Click Add Webhook to save.
Here’s what each part of the URL does:
to= : this is where the email is sent. Our demo uses a data entry field named to. You can add multiple addresses, separated by commas.
from= : this is the return address of the email. We’re sending from email@example.com. Put your own address here if you like.
subject= : This is the subject line of the email. The demo gathers this from a variable named subject.
body_url= : This is the web page that is used as the template for the email. It needs to be URL encoded. The template URL can have placeholders for the variables you collect, as you can see in the example template here.
session_id=#session# : This is used to get the form data collected from the session. The variables from your session can be merged into the template.
Once you have your webhook in place, you can build your tree. The demo tree we built as follows:
- We created a node that uses data entry fields to gather a “to” email address and a subject line. This is node #5 in the demo tree.
- Node #5 links to node #3, which sends a message to the webhook send email from demo template we created previously:
Sending Plain Text Emails
A more basic way to send emails is via simple text messages. Instead of body_url as a Webhook parameter, include something like the following:
The message needs to have + characters used instead of space characters.
The webhook URL for this method in the demo gallery tree (which uses a variable named body for the contents of the message body) looks like this:
We’re always here to help you with some of the more technical stuff, so if you need help setting up a customer email delivery node, just ask!