aboutsummaryrefslogblamecommitdiffstats
path: root/actionmailer/test/mailers/params_mailer.rb
blob: 84aa3363113133150d97ee78c85ede427c84d6b4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13

                             










                                                                           
# frozen_string_literal: true

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