Hello,
Am a newbie to Ruby. Please help me find out why this snippet of code is
failing and picking up the first case always:
class ContactUsMailer < ActionMailer::Base
default :from => “[email protected]”
def contact_us_email(name, message, purpose, email)
@name = name
@message = message
@purpose = purpose
@email = email
content_type “text/html”
case @purpose
when ‘android’
mail(:to => ‘[email protected]’, :subject => purpose)
when ‘marketing’
mail(:to => ‘[email protected]’, :cc => ‘[email protected],
[email protected]’, :subject => purpose)
when ‘ios’
mail(:to => ‘[email protected]’, :subject => purpose)
when ‘recruitment’
mail(:to => ‘[email protected]’, :cc => ‘[email protected]’, :subject
=> purpose)
when ‘general’
mail(:to => ‘[email protected]’, :subject => purpose)
else
mail(:to => ‘[email protected]’, :subject => purpose)
end
end
end
Regards !