Quantcast
Channel: Zingtree Technical Blog
Viewing all articles
Browse latest Browse all 405

Sending Custom Email From Decision Trees

$
0
0

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 enable a Webhook app on the node that sends email. Here’s how:

  1. Edit the node that you want to send email from. When this node is visited, an email will be sent.
  2. Click Show Advanced Options.
  3. In Send message to App, select Webhook: Zingtree Send Custom Email.

  4. For the Message, enter this:
    &to=#to#&from=demo@zingtree.com&subject=#subject#&body_url=https%3A%2F%2Fzingtree.com%2Fdemo%2Femail-template-demo.html
  5. Click Save Changes

Here’s what each part of the message 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.

The Email Webhook Demo tree from the Gallery illustrates how this is done. You can examine it and see for yourself how it’s built.

  1. 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.
  2. Node #5 links to node #3, which sends a message to the webhook Zingtree: Send Custom Email:

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 in the message:

body=This+is+a+text+message

The message needs to have + characters used instead of space characters.

The message part of the node looks like this:

&from=demo@zingtree.com&to=#to#&subject=#subject#&body=#body#

An example from the Gallery tree is here at node #2.

Need Help?

We’re always here to help you with some of the more technical stuff, so if you need help setting up a custom email delivery node, just ask.

This article was originally published on July 17, 2017, but the information is just as good and relevant as ever!


Viewing all articles
Browse latest Browse all 405

Trending Articles