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.
This Gallery tree illustrates both methods.
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:
https://zingtree.com/apps/webhook/lib/send-customer-email.php?to=#to#&from=demo@zingtree.com&subject=#subject#&body_url=https%3A%2F%2Fzingtree.com%2Fdemo%2Femail-template-demo.html&session_id=#session#
- 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 demo@zingtree.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:
body=This+is+a+text+message
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:
https://zingtree.com/apps/webhook/lib/send-customer-email.php?from=demo@zingtree.com&to=#to#&subject=#subject#&body=#body#&session_id=#session#
Need Help?
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!