Michael Rog presents

RogEE: Add-ons for ExpressionEngine 2

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

Note: The to parameter accepts multiple email addresses, comma-separated.

Variables

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).