Completed
Branch master (ce2c9c)
by Jesus
04:32
created

UserMailer.invite_email()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
# frozen_string_literal: true
2
3
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
#
5
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
6
#
7
# This program is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU Lesser General Public License as published by the Free Software
9
# Foundation; either version 3.0 of the License, or (at your option) any later
10
# version.
11
#
12
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
#
16
# You should have received a copy of the GNU Lesser General Public License along
17
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
19
class UserMailer < ApplicationMailer
20
  default from: Rails.configuration.smtp_sender
21
22
  def verify_email(user, url, image, color)
23
    @user = user
24
    @url = url
25
    @image = image
26
    @color = color
27
    mail(to: @user.email, subject: t('landing.welcome'))
28
  end
29
30
  def password_reset(user, url, image, color)
31
    @user = user
32
    @url = url
33
    @image = image
34
    @color = color
35
    mail to: user.email, subject: t('reset_password.subtitle')
36
  end
37
38
  def user_promoted(user, url, image, color)
39
    @url = url
40
    @admin_url = url + "admins"
41
    @image = image
42
    @color = color
43
    mail to: user.email, subject: t('mailer.user.promoted.subtitle')
44
  end
45
46
  def user_demoted(user, url, image, color)
47
    @url = url
48
    @root_url = url
49
    @image = image
50
    @color = color
51
    mail to: user.email, subject: t('mailer.user.demoted.subtitle')
52
  end
53
54
  def invite_email(name, email, url, image, color)
55
    @name = name
56
    @email = email
57
    @url = url
58
    @image = image
59
    @color = color
60
    mail to: email, subject: t('mailer.user.invite.subject')
61
  end
62
63
  def approve_user(user, url, image, color)
64
    @user = user
65
    @url = url
66
    @image = image
67
    @color = color
68
    mail to: user.email, subject: t('mailer.user.approve.subject')
69
  end
70
71
  def approval_user_signup(user, url, image, color, admin_emails)
72
    @user = user
73
    @url = url
74
    @image = image
75
    @color = color
76
77
    mail to: admin_emails, subject: t('mailer.user.approve.signup.subject')
78
  end
79
80
  def invite_user_signup(user, url, image, color, admin_emails)
81
    @user = user
82
    @url = url
83
    @image = image
84
    @color = color
85
86
    mail to: admin_emails, subject: t('mailer.user.invite.signup.subject')
87
  end
88
end
89