Layout in Email

Hello All:

I want to apply a layout to all the mails going from my application.
I created a layout tempalte file named mail.rhtml in the ‘layout’
directory.
Now where should i specify the layout details to incorporate them in
mail and how?

TIA,

Priya S.

Hi Priya
In the controller you have to specify at the top like “layout “mail””

Abhi M. wrote:

Hi Priya
In the controller you have to specify at the top like “layout “mail””

Dear Abhi:

Thanks for ur reply…
I tried it … bt didnt work… I mean the mail was all the same…
Also writing it on top of the controller will apply this to all the
actions. but i want it just for a specific action…

Regards,
Priya

Abhi M. wrote:

Hi

Check this

http://wiki.rubyonrails.org/rails/pages/HowtoWrapViewsWithLayouts check
partial layouts

if it helped let me know

Hi Abhi:

No… didnt get any help from the source,…
I hope im able to clearly explain you my issue…

Regards,
Priya

Hi

Check this

http://wiki.rubyonrails.org/rails/pages/HowtoWrapViewsWithLayouts check
partial layouts

if it helped let me know

Hi

there in the link there is a section called partial layout . using that
we can implement differebnt layout for some views I think

Abhi M. wrote:

Hi

there in the link there is a section called partial layout . using that
we can implement differebnt layout for some views I think

Abhi:

Different layouts is not the need… What i need is… Applying the
layout should be reflected in the sent mail…
I know how to apply layouts in general… but now i want it specific to
‘send mail’ action.

Priya

Bala kishore Pulicherla wrote:

if you want to apply a layout for a specific action you can do like this
in the controller say layout => ‘main_layout’, :except => ‘your_action’

in the action say
render :layout => ‘mail_layout’

Hi Bala:

Writing layout => ‘main_layout’, :except => ‘your_action’ in controller
returns syntax error… plz send the corrected statement.

Thanks
Priya

if you want to apply a layout for a specific action you can do like this
in the controller say layout => ‘main_layout’, :except => ‘your_action’

in the action say
render :layout => ‘mail_layout’

What you need is this:

hope it helps…
cheers…

On Oct 29, 8:15 pm, Priya S. [email protected]

ooooops sorry
layout ‘main_layout’, :except => ‘your_action’

but i think to get ur requirement u had to put some thing like
@content_type
= “text/html” in the mailer action

Jet wrote:

What you need is this:

Welcome cardboardrocket.com - BlueHost.com

hope it helps…
cheers…

On Oct 29, 8:15 pm, Priya S. [email protected]

Hey Jet:

Thanks man… this is what i was looking for…
Worked perfectly fine…

Best Regards,
Priya S.