Class: InstanceUserRoleRequestMailer

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

Instance Method Summary collapse

Instance Method Details

#new_role_request(request, recipient) ⇒ Object

Emails an admin, informing him of the role request.


10
11
12
13
14
15
# File 'app/mailers/instance_user_role_request_mailer.rb', line 10

def new_role_request(request, recipient)
  @recipient = recipient
  @request = request

  mail(to: @recipient.email, subject: t('.subject'))
end

#role_request_approved(instance_user) ⇒ Object

Emails an admin, informing him of the role request.


20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/mailers/instance_user_role_request_mailer.rb', line 20

def role_request_approved(instance_user)
  return if instance_user.normal?

  @instance_user = instance_user
  @recipient = instance_user.user

  ActsAsTenant.without_tenant do
    @instance = instance_user.instance
  end

  mail(to: instance_user.user.email, subject: t('.subject'))
end