Email-from-Template 1.5.0
Sends the tag contents in an e-mail (with or without echoing the contents back to the template).
I wrote this plugin was mostly a learning exercise, to get a knack for EE development. As I have come to find out, Adam Khan released a similar plugin, and his plugin can be installed on EE 1.6+ as well. (My Email-from-Template offers variable replacement, parameter defaults, and entity decoding, though.)
Installation
After you download the plugin files from the code repository, upload them to /system/expressionengine/third_party/email_from_template/ on your server. The installed plugin should appear in the Add-ons section of the CP.
Example: General Use
{exp:email_from_template to="admin@ee.com" from="server@ee.com" subject="Hello!"}
This tag content is being viewed at {uri_string} by {httpagent}. Sending notification to {to}.
{/exp:email_from_template}
{if group_id == 1}
My secret stuff goes here.
{if:else}
{exp:email_from_template subject="Unauthorized Access!" echo="off"}
Somebody tried to access the secret content at {uri_string} -- beware!
{/exp:email_from_template}
Sorry, nothing here for you.
{/if}
Parameters
- to - destination email address (default: site webmaster)
- cc - [optional] email address to carbon-copy
- bcc - [optional] email address to blind-carbon-copy
- from - sender email address (default: site webmaster)
- subject - email subject line (default: template URI)
- decode_subject_entities - Set to "no" if you don't want to parse the HTML entities in the subject line.
- decode_message_entities - Set to "no" if you don't want to parse the HTML entities in the message text.
- mailtype - "text" or "html"
- alt_message - [optional] a text-only message (for email clients that don't support HTML email)
- attachments - comma-separated list of server paths to files
- echo - Set to "off" if you don't want to display the tag contents in the template.
Note: The to parameter accepts multiple email addresses, comma-separated.
Variables
{to}{cc}{bcc}{from}{subject}{ip}{httpagent}{uri_string}
Use with other plugins and tags
When you want to email the output of other tags, put your {exp:email_from_template} tag inside the other tag and set parse="inward" on the outer tag(s).