Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (44 sloc) 1.82 KB

Email Page

Email pages, and keep track of how many times each page was emailed.

Installation

$ cd <radiant_app>/vendor/extensions/
$ git clone <email_page_git_url> email_page

Usage

Add this to pages that should be emailable:

<a id="email_page_link" href='<r:email_page:url/>'>Email This Page</a>
<div id="email_page_count"><r:email_page:count/></div>

Create a page of type Email with a body part like this:

<r:email_page:form [subject="Recommendation"]>
  <r:error>
    <div id="email_page_errors">
      <h4>Please correct the errors below.</h4>
      <ul>
        <r:error on="from"><li>Your email address <r:message /></li></r:error>
        <r:error on="recipients"><li>The recipient email address <r:message /></li></r:error>
      </ul>
    </div>
  </r:error>

  <h3><r:page_title/></h3>

  <div class="field<r:error on="from"> error</r:error>">
    <label for="from">From:</label>
    <r:text name="from"/>
  </div>
  <div class="field<r:error on="recipients"> error</r:error>">
    <label for="recipients">Recipients:</label>
    <r:text name="recipients"/>
  </div>
  <input type="submit">
</r:email_page:form>

Optionally customize the email by adding an email or email_html part to the Email page like this:

<r:email_page>
<r:from/> enjoyed reading this page <r:page_url/> and thinks you might too.
</r:email_page>

TODO

  • display friendly error message if there is no page of type Email

  • handle finding multiple “Email” type pages

Home

http://github.com/mikehale/radiant-email-page-extension/tree/master

Credits

Sponsored by Ignite Social Media LLC - ignitesocialmedia.com/ Heavily influenced by Mailer Extension for Radiant (there is probably a way to refactor this extension to make use of it).

See LICENSE for copyright and licensing details.