Git Product home page Git Product logo

radiant-mailer-extension's Introduction

Mailer Extension for Radiant

The Mailer extension enables form mail on a page.

Usage

You can define email templates using pages parts (email, and/or email_html). You configure the recipients and other Mailer settings in a “mailer” part:

subject: From the website of Whatever
from: [email protected]
redirect_to: /contact/thank-you
recipients:
  - [email protected]
  - [email protected]

The following tags are available to help you build the form:

<r:mailer:form name=""> ... </r:mailer:form> 
<r:mailer:text name="" /> 
<r:mailer:checkbox name="" />
<r:mailer:radio name="" />
<r:mailer:radiogroup name=""> ... </r:mailer:radiogroup>
<r:mailer:select name=""> ... </r:mailer:select>
<r:mailer:date_select name=""/>
<r:mailer:textarea name=""> ... </r:mailer:textarea>
<r:mailer:option name="" />

When processing the form (in email and email_html), the following tags are available:

<r:mailer:get name="" />
<r:mailer:get_each name=""> ... </r:mailer:get_each>
  <r:mailer:index />

Simple example of a form:

<r:mailer:form>
 <r:mailer:hidden name="subject" value="Email from my Radiant site!" /> <br/>
  Name:<br/>
 <r:mailer:text name="name" /> <br/>
  Message:<br/>
 <r:mailer:textarea name="message" /> <br/>
 <input type="submit" value="Send" />
</r:mailer:form>

User-provided Configuration

Sometimes, rather than explicitly configuring the recipients and such in the mailer part, you’d rather have them passed in by the person submitting the form. Mailer supports this by allowing you to specify a form field to pull the value from:

from_field: my_form_field_that_contains_the_from_email_address

Then you just have to add that field to your mailer form and you’re all set.

This is supported for the from (from_field), recipients (recipients_field) and reply_to (reply_to_field) properties.

Enabling action_mailer

In environment.rb you’ll probably need to change:

config.frameworks -= [ :action_mailer ]

to:

config.frameworks -= []

Caveats

Relative urls will almost certainly not work if the mailer fails validation. Solution? Only use absolute urls.

History

Created by: M@ McCray - mattmccray.com

Version: 0.2.1
Contact: [email protected]

Ported to ‘mental’ by: Sean Cribbs - seancribbs.com

Version: 0.1
Contact: [email protected]

Seriously restructured by: Nathaniel Talbott - terralien.com

Version: 0.2
Contact: [email protected]
Work sponsored by: Ignite Social Media, http://ignitesocialmedia.com/

Todo

  • Support for file attachments to emails

  • Tests

radiant-mailer-extension's People

Contributors

jstirk avatar moklett avatar seancribbs avatar yeah avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.