Class: UserMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/user_mailer.rb

Instance Method Summary collapse

Instance Method Details

#test(recipient) ⇒ Mail::Message|nil

Note:

Subject should be set via I18n file at config/locales/en.yml with the following key: en.user_mailer.test.subject

Returns nil if mail could not be created

Parameters:

  • recipient (User|String)
    • can be used with a email address or a User

Returns:

  • (Mail::Message|nil)

    nil if mail could not be created


8
9
10
11
12
13
14
# File 'app/mailers/user_mailer.rb', line 8

def test(recipient)
  email = recipient.is_a?(User) ? recipient.email : recipient
  mail(to: email) do |format|
    format.text
    format.html
  end
end