rails/actionmailer/test/mailers/params_mailer.rb
David Heinemeier Hansson 1cec84ad2d Offer the option to use parameterization for shared processing of headers and ivars (#27825)
Offer the option to use parameterization for shared processing of headers and ivars
2017-01-28 11:20:46 +01:00

12 lines
327 B
Ruby

class ParamsMailer < ActionMailer::Base
before_action { @inviter, @invitee = params[:inviter], params[:invitee] }
default to: Proc.new { @invitee }, from: -> { @inviter }
def invitation
mail(subject: "Welcome to the project!") do |format|
format.text { render plain: "So says #{@inviter}" }
end
end
end