Class: InviteUserMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/invite_user_mailer.rb

Instance Method Summary collapse

Instance Method Details

#invite_user(invitor, object, to) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/mailers/invite_user_mailer.rb', line 4

def invite_user(invitor, object, to)
  @invitor = invitor
  @object = object
  @object_type = object.class.name.casecmp('workgroup').zero? ? 'group' : object.class.name.downcase
  @to = to

  # Postmark metadatas
  ['object-type'] = @object_type

  mail(
    to: "<#{to.email}>",
    subject: "You have been invited to join a #{@object_type}",
    tag: 'invite-user'
  )
end