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("danny@XXXXX.co.uk", "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
I worked this out:
In the user_mailer view you can put the <%=h @kase.jobno %> – <%=h @kase.casesubject %> tags just like you would in the show view for Kases.
Hope this helps someone else.
Thanks,
Danny