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
|
|
|
include ApplicationHelper |
21
|
|
|
include ThemingHelper |
22
|
|
|
|
23
|
|
|
default from: Rails.configuration.smtp_sender |
24
|
|
|
|
25
|
|
|
def verify_email(user, url, settings) |
26
|
|
|
@settings = settings |
27
|
|
|
@user = user |
28
|
|
|
@url = url |
29
|
|
|
@image = logo_image |
30
|
|
|
@color = user_color |
31
|
|
|
mail(to: @user.email, subject: t('landing.welcome')) |
32
|
|
|
end |
33
|
|
|
|
34
|
|
|
def password_reset(user, url, settings) |
35
|
|
|
@settings = settings |
36
|
|
|
@user = user |
37
|
|
|
@url = url |
38
|
|
|
@image = logo_image |
39
|
|
|
@color = user_color |
40
|
|
|
mail to: user.email, subject: t('reset_password.subtitle') |
41
|
|
|
end |
42
|
|
|
|
43
|
|
View Code Duplication |
def user_promoted(user, role, url, settings) |
|
|
|
|
44
|
|
|
@settings = settings |
45
|
|
|
@url = url |
46
|
|
|
@admin_url = url + "admins" |
47
|
|
|
@image = logo_image |
48
|
|
|
@color = user_color |
49
|
|
|
@role = translated_role_name(role) |
50
|
|
|
mail to: user.email, subject: t('mailer.user.promoted.subtitle', role: translated_role_name(role)) |
51
|
|
|
end |
52
|
|
|
|
53
|
|
View Code Duplication |
def user_demoted(user, role, url, settings) |
|
|
|
|
54
|
|
|
@settings = settings |
55
|
|
|
@url = url |
56
|
|
|
@root_url = url |
57
|
|
|
@image = logo_image |
58
|
|
|
@color = user_color |
59
|
|
|
@role = translated_role_name(role) |
60
|
|
|
mail to: user.email, subject: t('mailer.user.demoted.subtitle', role: translated_role_name(role)) |
61
|
|
|
end |
62
|
|
|
|
63
|
|
|
def invite_email(name, email, url, settings) |
64
|
|
|
@settings = settings |
65
|
|
|
@name = name |
66
|
|
|
@email = email |
67
|
|
|
@url = url |
68
|
|
|
@image = logo_image |
69
|
|
|
@color = user_color |
70
|
|
|
mail to: email, subject: t('mailer.user.invite.subject') |
71
|
|
|
end |
72
|
|
|
|
73
|
|
|
def approve_user(user, url, settings) |
74
|
|
|
@settings = settings |
75
|
|
|
@user = user |
76
|
|
|
@url = url |
77
|
|
|
@image = logo_image |
78
|
|
|
@color = user_color |
79
|
|
|
mail to: user.email, subject: t('mailer.user.approve.subject') |
80
|
|
|
end |
81
|
|
|
|
82
|
|
|
def approval_user_signup(user, url, admin_emails, settings) |
83
|
|
|
@settings = settings |
84
|
|
|
@user = user |
85
|
|
|
@url = url |
86
|
|
|
@image = logo_image |
87
|
|
|
@color = user_color |
88
|
|
|
|
89
|
|
|
mail to: admin_emails, subject: t('mailer.user.approve.signup.subject') |
90
|
|
|
end |
91
|
|
|
|
92
|
|
|
def invite_user_signup(user, url, admin_emails, settings) |
93
|
|
|
@settings = settings |
94
|
|
|
@user = user |
95
|
|
|
@url = url |
96
|
|
|
@image = logo_image |
97
|
|
|
@color = user_color |
98
|
|
|
|
99
|
|
|
mail to: admin_emails, subject: t('mailer.user.invite.signup.subject') |
100
|
|
|
end |
101
|
|
|
end |
102
|
|
|
|