I looked at the code of the mailer extension and found this:
 def config
   @config ||= begin
     page = self
     until page.part(:mailer) or (not page.parent)
       page = page.parent
     string = page.render_part(:mailer)
     (string.empty? ? {} : YAML::load(string))

It tends to suggest that if the parent has a mailer part, it should be fine. Can you try to create a mailer part in the top page and try?

5/28/2009 | 12:02 AM.

Mohit Sindhwani wrote:
N. Turnage wrote:
I just looked at its readme and it says:
You configure the recipients and other Mailer settings in a "mailer" part
The form and it's config are set up properly. On the /contact page everything works perfectly. But on other pages it doesn't.

I'm guessing that's because you have a "mailer" part on the contact page.

Just a suggestion:
1. You may be able to use:

 from_field: my_form_field_that_contains_the_from_email_address
with a snippet that has the mailer form.
This won't help. This is just to set the "From" field to the address of the user submitting the form.

Hmm, I see.. I think I misread that part of the document.

2. It seems that you mailer may be failing because you don't have a mailer part. It may be that with your current code, you also need the mailer part on your pages.
Yeah, it's set up properly. This isn't the issue...

Wait a minute, does this mean that even if the form is in a snippet, each page (every page for me) needs a mailer and an email part to allow for processing the form? If so, is there a way of "creating" a page part in my template so that I don't have to add mailer and email parts to every page? So I can do something like this:

<r:part:new name="mailer">
   <r:find url="/contact">
      <r:content part="mailer" />

I don't think you can create page parts in a template. You may have to create that on each page, but once you create that you could do something like:
<r:snippet name="mailer_config" /> in that part on every page.

You could go one step further and set the mailer part to be a default created part on each page.


Relative urls will almost certainly not work if the mailer fails validation. Solution? Only use absolute urls.
How would that affect me here?

Sorry, it won't affect you. I meant that I have a solution that might fit this problem. That's why I shall send it out separately with a subject of its own, in case it helps someone else.

Hope this helps.

5/27/2009 | 11:52 PM.

Radiant mailing list

Radiant mailing list

Reply via email to