Transactional emails, sometimes called "triggered" mail, are used to send an individual, or a small group of individuals, a notification. Some examples of common transactional mails on websites:
Many traditional web apps use their own SMTP servers and templates maintained in the code repository. This is often inflexible and poor for delivery.
Sailthru makes it easy to maintain and set up these kinds of emails via "templates."
The Templates link in the main menu provides an interface where you can manage your transactional templates. Each template has a case-sensitive name which you will use to refer to it later.
Obviously, you won't want to send the exact same email every time, so you can personalize the email with replacement variables, or vars for short. Replacement vars are case-sensitive and denoted with {curly_braces}.
<p>Dear {name},</p>
<p>Welcome to Example.com! Your username is <b>{username}</b>.
For the most part, you can use any replacement variables you want, but you should stay away from a few reserved words listed at the bottom of this page.
Replacement vars can be used in the From Name, Subject, Code and Text Version fields.
Most of the time, you only need replacement vars. Sailthru also has a much more powerful syntax with control structures like {if} and {foreach} – see syntax for more on that.
You can do this from your code with the send API call. There are a number of options that are documented in the send call, but at a basic level you can use one of our client libraries to send in as little as a single line of code:
$sailthru->send('my_template', 'example@example.com', array('var_1' => 'Value A'));
sailthru.send('my_template', 'example@example.com', { 'var_1' => 'Value A' } )