Skip to content

Instantly share code, notes, and snippets.

@8parth
Created March 23, 2017 05:54
Show Gist options
  • Save 8parth/58ce188efca71c14890e618f6c900765 to your computer and use it in GitHub Desktop.
Save 8parth/58ce188efca71c14890e618f6c900765 to your computer and use it in GitHub Desktop.
new parameterized mailers example
class UserMailer < ApplicationMailer
before_action {
@email = params[:email]
@name = params[:name]
@message = params[:message]
}
default to: -> { @email },
from: -> { "[email protected]" }
def sign_up
mail subject: "Confirm your email!"
end
def welcome
mail subject: "Welcome to Example."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment