# Radiant Mailer Behavior

**URL:** <https://www.ruby-forum.com/t/radiant-mailer-behavior/96264>\
**Category:** Radiant CMS\
**Created:** [June 27, 2006, 8:00pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264 "2006-06-27T20:00:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 27, 2006, 8:00pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/1 "2006-06-27T20:00:51Z")

</div>

Hi,

i am pretty much excited by using Radiant. I am a bit confused by the  
Mailer  
behavior. I am trying to implement it but it gives me errors. Can  
someone  
talk about this from his experience?

Also config part needs to be defined the same way as a page part, right?  
Is  
there a need of defining smtp?

Thanks in advance.

Regards,

Rizwan R.

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 27, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/2 "2006-06-27T20:07:02Z")

</div>

Hello.

On 6/27/06, Rizwan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i am pretty much excited by using Radiant. I am a bit confused by the Mailer  
> behavior. I am trying to implement it but it gives me errors. Can someone  
> talk about this from his experience?

[http://lists.radiantcms.org/pipermail/radiant/2006-June/000643.html](http://lists.radiantcms.org/pipermail/radiant/2006-June/000643.html)

> Also config part needs to be defined the same way as a page part, right? Is

Yes.

> there a need of defining smtp?

No.

–M

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 27, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/3 "2006-06-27T20:33:05Z")

</div>

Thanks for the reply. I also had revision 56 of radiant so I am using  
the  
behavior with that for the time being. Now I am getting the following  
error.  
Is there anything in particular I can do to make it work.

You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occured while evaluating nil.[]

Rizwan

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/4 "2006-06-29T15:40:45Z")

</div>

Has it been addressed in the 0.5 grindstone release?

RIzwan

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/5 "2006-06-29T15:46:46Z")

</div>

Rizwan R. wrote:

> Has it been addressed in the 0.5 grindstone release?

Probably not. I’d suggest you e-mail Matt McCray directly with questions  
about the mailer behavior ([http://mattmccray.com/](http://mattmccray.com/)). Or even better, find  
the problem and submit a patch to him.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 5:21pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/6 "2006-06-29T17:21:18Z")

</div>

I can’t get accented characters like umlauts to work properly with  
Radiant. HTML entities work, but that’s a little bit too complicated  
for most users… Idealy people should be able to cut and paste text  
from word into a Radiant form and the accents would just keep working…

Anyone?

–  
Jeroen J.  
Laika online entertainment

* * *

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 6:36pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/7 "2006-06-29T18:36:42Z")

</div>

Rizwan R. wrote:

> Now I am getting the following error. Is there anything in particular  
> I can do to make it work.
> 
> You have a nil object when you didn’t expect it!
> 
> You might have expected an instance of Array.  
> The error occured while evaluating nil.[]  
> When are you getting this error, exactly? When it tries to show the  
> page, or when you submit it?

Also, do you have any other plugins installed?

I did notice that the example config part is malformed in the README…  
It should look like this:

mailers:  
contact:  
subject: From the website of Whatever  
from: removed\_email\_address@domain.invalid  
redirect\_to: /contact/thank-you  
recipients:  
- removed\_email\_address@domain.invalid  
- removed\_email\_address@domain.invalid

Also, you’ll need to add an ‘email’ (or ‘email\_html’) part as well. It’s  
the template that’s used for the email itself.

Thanks,  
M@

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/8 "2006-06-29T18:55:25Z")

</div>

Rizwan R. wrote:

> Now I am getting the following error. Is there anything in particular  
> I can do to make it work.
> 
> You have a nil object when you didn’t expect it!
> 
> You might have expected an instance of Array.  
> The error occured while evaluating nil.[]

I just thought of something that might cause this – Let’s say the  
following is my emailer form:

\<r:mailer:form name=“contact”\>  
_Name:_ \<r:mailer:text name=“name” /\>  
  
_City:_ \<r:mailer:text name=“city” /\>  
  
_Email:_ \<r:mailer:text name=“email” /\>  
  
\<r:mailer:submit /\>  
\</r:mailer:form\>

And here’s my ‘config’ part:

mailers:  
contact:  
subject: From the website of Whatever  
from: removed\_email\_address@domain.invalid  
redirect\_to: /contact/thank-you  
recipients:  
- removed\_email\_address@domain.invalid

I would also have an ‘email’ part:

\<r:mailer:get name=“name”/\> submitted the following:  
City = \<r:mailer:get name=“city”/\>  
Email = \<r:mailer:get name=“email”/\>

Now, I’d need to make sure the _name_ of the mailer:form exists in the  
_mailers:_ config section. In the example above, they are both named  
‘contact’. So if you use something different, be sure they match up.

Why did I make it where you have to name the mailer form configuration?  
Simple. Because this will allow for multiple mailers on the same page.

I think I need to work on documentation for the mailer… 🙂

Cheers,  
M@

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/9 "2006-06-29T17:49:57Z")

</div>

Rizwan R. wrote:

> Has it been addressed in the 0.5 grindstone release?

Not yet, I will have a look at it – probably this evening. Hopefully,  
I’ll have an updated version out there tonight.

~M@

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 7:04pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/10 "2006-06-29T19:04:43Z")

</div>

On Jun 29, 2006, at 11:55 AM, M@ McCray wrote:

> I think I need to work on documentation for the mailer… 🙂

Please codify the assumption you tracked down by raising a specific  
exception instead of letting Ruby barf. That gives you an opportunity  
to convey exactly what the problem is, where, and why, and gives the  
rest of us something to feed to/retrieve from Google.

–  
Ryan P.  
Senior Developer, SubscriberMail, LLC

3333 Warrenville Rd.  
Suite 530  
Lisle, IL 60532  
(630) 303-5072

Not Just Email…SubscriberMail

> **[subscribermail.com domain name is for sale. Inquire now.](https://www.subscribermail.com/)**
>
> subscribermail.com is available for purchase. Get in touch to discuss the possibilities!

This message (including attachments) contains proprietary information  
which may not be disclosed or used beyond the purposes of this  
message without the written consent of SubscriberMail, LLC. If you  
receive this message in error, notify the sender and destroy this  
message and all attachments immediately. Thank you.

SubscriberMail is covered under US PATENT 6,769,002

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [June 29, 2006, 9:05pm UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/11 "2006-06-29T21:05:35Z")

</div>

I think the problem I am having on the localhost is connection error.

But on the hosted servers where the live radiant copy is working, it  
shows:

protected method `get\_class\_name’ called for #\<MailerBehavior:  
0x409b6698\>

Any hopes?

Thanks for the behavior, btw!

Rizwan

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [July 4, 2006, 10:48am UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/12 "2006-07-04T10:48:56Z")

</div>

On 6/29/06, Jeroen J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I can’t get accented characters like umlauts to work properly with Radiant.  
> HTML entities work, but that’s a little bit too complicated for most  
> users… Idealy people should be able to cut and paste text from word into a  
> Radiant form and the accents would just keep working…

Have you tried to set the content-type of your main layout as  
“text/html; charset=utf-8”?

---

<div class="post-metadata">

**Author:** ![hrrzone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@hrrzone](https://www.ruby-forum.com/u/hrrzone)\
**Post date:** [July 4, 2006, 11:01am UTC](https://www.ruby-forum.com/t/radiant-mailer-behavior/96264/13 "2006-07-04T11:01:27Z")

</div>

On Jul 4, 2006, at 10:46 AM, Ollivier R. wrote:

> > I can’t get accented characters like umlauts to work properly with  
> > Radiant.  
> > HTML entities work, but that’s a little bit too complicated for most  
> > users… Idealy people should be able to cut and paste text from  
> > word into a  
> > Radiant form and the accents would just keep working…
> 
> Have you tried to set the content-type of your main layout as  
> “text/html; charset=utf-8”?

Well, I’ll be damned… I thought I did, but apparently not.

Thanks! And sorry for wasting everyone’s time. 🙂

–  
Jeroen J.  
Laika online entertainment

* * *
