I have a two mailers
welcome_manger(user) welcome_participant(user)
Both send different information and have different layouts.
when I call the deliver method I would like to use something like the following
UserMailer.welcome_self.role(self.user)
This does not work. How can I accomplish this?
Something like this perhaps:
Assuming that
self.rolereturns a String.The
sendmethod invokes a method by name:So you just need to build the appropriate method name as a string and then convert it a symbol with
to_sym.