Include dynamic info in Rails emails
- by Danny McClelland
Hi Everyone,
I have managed to get my email problem sorted so now everytime a case is created an email goes out to the specified address.
I have a usermailer.rb
def makeakase(email, name, jobno, casesubject)
recipients email
from "no-reply@your_rails_app.com"
subject "FW: Kase creation from Survey Manager"
sent_on Time.now
body :name => name
end
and I have the kases_controller.rb:
if @kase.save
UserMailer.deliver_makeakase("[email protected]", "Highrise")
In the body I would like to use the tags that I use in the kase show view such as:
<%=h @kase.jobno %> - <%=h @kase.casesubject %>
but they don't work, I get the following error:
wrong number of arguments (2 for 4)
Any ideas?
Thanks,
Danny