Following this post and this post I put together the following.
In app/helpers/mailer_helper.rb:
module MailerHelper
def sys_addy
@sys_addy = current_site == "site1" ? "me@site1.com" : "me@site2.com"
end
end
Attempt 1 placing the helper method call above the method - app/mailers/user_mailer.rb:
class UserMailer < ActionMailer::Base
helper :mailer
sys_addy
default :from => @sys_addy
def notice_email
...
end
end
Attempt 2 placing the helper method call inside the method - app/mailers/user_mailer.rb:
class UserMailer < ActionMailer::Base
helper :mailer
def notice_email
sys_addy
...
mail( ...:from => @sys_addy )
end
end
In both cases I got:
NameError (undefined local variable or method `sys_addy'
Thanks for your help.