views:

30

answers:

1

Hi,

Am using action mailer in ruby on rails.

I just want to filter the recipient emails according to email_bounce flag in users table.

Is it possible to use any filter in mailer

A: 

I recommend doing this in controller use mailer for sending emails only. I normally learn to keeping logic in model and controller

Tam
Actually what you said is correct. But in my case i want handle for all the messages in a mailer.... if i write the code in model or else in the controller means i want to check the condition in controller and model where ever i used. So only i have asked this question.
Ramanavel
I suggest then putting the logic in Application Controller so that all controllers have access to it. Also you can also try something like Meta Programming where you pass in object and call something like eval(object_name).someoperation if you have the operation applied to different types of objects
Tam