Class: Spotlight::InvitationMailer

Inherits:
ActionMailer::Base
  • Object
show all
Includes:
Devise::Mailers::Helpers
Defined in:
app/mailers/spotlight/invitation_mailer.rb

Overview

Mailer for contacting new exhibit curators or administrators

Instance Method Summary collapse

Instance Method Details

#exhibit_invitation_notification(role) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/mailers/spotlight/invitation_mailer.rb', line 8

def exhibit_invitation_notification(role)
  initialize_from_record(role.user)
  @role = role
  @key = if @role.resource.is_a?(Spotlight::Site)
           'exhibits_admin_invitation_mailer'
         else
           'invitation_mailer'
         end
  mail(to: role.user.email,
       from: mailer_sender(devise_mapping),
       subject: I18n.t("spotlight.#{@key}.invitation_instructions.subject", exhibit_name: @role.resource.title))
end