Forum: Radiant CMS Is there any kind of validation in the mailer extension?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nate T. (Guest)
on 2008-11-15 18:26
(Received via mailing list)
I am using the mailer extension for the first time and was wondering if
there is any kind of form validation built into the extension. I looked
the code and I cannot find anything. Did I miss something? How are other
people doing form validation with mailer?


Hamish Rickerby (Guest)
on 2008-11-16 10:20
(Received via mailing list)
Hi Nate,

The mailer extension supports very simple validation.  It enforces
mandatory fields, and ensures the "from" and "recipients" fields
exists and have an @ in the email address.  The from and recipients
enforcement comes right out of the box.  Nothing to do to get that

To make a mandatory field, you add a required attribute

<r:mailer:textarea name="message" required="true" />

When that field fails validation (no content is provided) you can get
at the error messages with the mailer errors tags.

   <r:mailer:error on="message" >
     <p>Message <r:mailer:error:message /></p>

the error message is "is required".

The error messages the from and recipients fields are stored against
the "form".  To access those...

   <r:mailer:error on="form" >
     <p><r:mailer:error:message /></p>

Hope that helps.


::: hamish rickerby :::
m: removed_email_address@domain.invalid
This topic is locked and can not be replied to.