# Howto use a template for the mailer extension

**URL:** <https://www.ruby-forum.com/t/howto-use-a-template-for-the-mailer-extension/121000>\
**Category:** Radiant CMS\
**Created:** [November 22, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/howto-use-a-template-for-the-mailer-extension/121000 "2007-11-22T14:55:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [November 22, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/howto-use-a-template-for-the-mailer-extension/121000/1 "2007-11-22T14:55:18Z")

</div>

Hello List,

In the README of the mailer extensions is mentioned that you can add a  
page  
part email and/or email\_html to use as a mail template.

I’ve looked it up in the mailer code:

plain\_body = part( :email ) ? render\_part( :email ) : render\_part(  
:email\_plain )  
html\_body = render\_part( :email\_html ) || nil

The mail form has something like:  
Naam:  
  
\<r:mailer:text name=“naam” /\>  
  
E-mail adres:  
  
\<r:mailer:text name=“email” /\>

How can I use this in a template? (I feel like an idiot, but I don;t get  
it)

Thanks.

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [November 22, 2007, 3:09pm UTC](https://www.ruby-forum.com/t/howto-use-a-template-for-the-mailer-extension/121000/2 "2007-11-22T15:09:56Z")

</div>

Found!

[http://dev.radiantcms.org/radiant/wiki/HowToUseMailerExtension](http://dev.radiantcms.org/radiant/wiki/HowToUseMailerExtension)

P.

On Nov 22, 2007 2:54 PM, Peter B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## The mail form has something like:
> 
> met vriendelijke groet,
> 
> Peter B.

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [November 22, 2007, 6:13pm UTC](https://www.ruby-forum.com/t/howto-use-a-template-for-the-mailer-extension/121000/3 "2007-11-22T18:13:15Z")

</div>

Hi Peter!

I had the same kind of questions,  
Because I have a page with several forms like “tell a friend”,  
“newsletter  
sign up”, and “contact us”, and I was thinking how to make it, because  
also  
are forms with special layouts, so the \<r:mailer:foo /\> tags are not  
usefull  
for me.

Which \<r:mailer:form /\> does is to make a form with attributes  
method=post  
and action=name-of-mailer-page  
And also add a hidden form field called mailer\_name with  
value=“the-name-of-the-mailer”, and then if you add, in example:  
\<r:mailer:text name=“naam” /\>

You’ll get something like

So, you can hardcode the form following this rules, and then have more  
flexibility.

Is a very basic workaround, but worked for me.

Regards,

Q.
