Jump to Content

Objective HTML

Postmaster

The definitive email solution for ExpressionEngine

Email Endpoint

Description

The email endpoint utility allows you to create an place to receive http requests that will in turn allow you to programmatically send emails. Using the simple template tags, along with any other EE tags you may need, you can send email for absolutely anything. This is great for creating your own email API's, sending emails after forms POST from other add-ons, or integrating within an existing application.


Required Hook

It's important to know that the endpoint merely triggers an event with some data for the email to be sent. Nothing will actually send without setting up a Hook within Postmaster. So navigate to the Postmaster module in the control panel. Create a new hook and use the Email Endpoint Hook.


Supported Services

All email services are supported.


Variables

The email endpoint is really configurable and open to your needs. To offer more flexibility, this tag doesn't use parameters in the traditional manner. Rather, it uses tag pairs to set the data. The follow list is the available tag pairs you can use to set email data. These operate the same as parameters, but are tag pairs instead to make parsing easier.

*Indicated required variables

to_email*
The recipient email address
to_name*
The recipient name
from_email*
The sender email
from_email*
The email subscription service of your choice. Currently MailChimp and CampaignMonitor are supported.
reply_to
The email subscription service of your choice. Currently MailChimp and CampaignMonitor are supported.
cc
The unique ID of the list in which to add your subscribers.
bcc
The unique ID of the list in which to add your subscribers.
subject*
The unique ID of the list in which to add your subscribers.
html_message*
The email used to subscribe to the list;
plain_message*
The email used to subscribe to the list;

Note, each tag pair is prefixed to avoid parse order conflicts. The default prefix "def:" (for define).

Example



{exp:channel:entries channel="some_channel" url_title="{segment_3}" dynamic="no"}

	{exp:postmaster:endpoint:email}

		{def:to_email}{your_name_field}{/def:to_email}
		{def:to_name}{your_to_email_field}{/def:to_name}

		{def:from_email}support@objectivhtml.com{/def:from_email}
		{def:from_name}Support{/def:from_name}

		{def:subject}{your_subject_field}{/def:subject}

		{def:html_message}{your_html_message_field}{/def:html_message}
		{def:plain_message}{your_plain_message_field}{/def:plain_message}
		
	{/exp:postmaster:endpoint:email}

{/exp:channel:entries}