|
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
|
|
|
module Emailer |
|
20
|
|
|
extend ActiveSupport::Concern |
|
21
|
|
|
|
|
22
|
|
|
# Sends account activation email. |
|
23
|
|
|
def send_activation_email(user) |
|
24
|
|
|
@user = user |
|
25
|
|
|
UserMailer.verify_email(@user, user_verification_link, logo_image, user_color).deliver |
|
26
|
|
|
end |
|
27
|
|
|
|
|
28
|
|
|
# Sends password reset email. |
|
29
|
|
|
def send_password_reset_email(user) |
|
30
|
|
|
@user = user |
|
31
|
|
|
UserMailer.password_reset(@user, reset_link, logo_image, user_color).deliver_now |
|
32
|
|
|
end |
|
33
|
|
|
|
|
34
|
|
|
# Returns the link the user needs to click to verify their account |
|
35
|
|
|
def user_verification_link |
|
36
|
|
|
request.base_url + edit_account_activation_path(token: @user.activation_token, email: @user.email) |
|
37
|
|
|
end |
|
38
|
|
|
|
|
39
|
|
|
def reset_link |
|
40
|
|
|
request.base_url + edit_password_reset_path(@user.reset_token, email: @user.email) |
|
41
|
|
|
end |
|
42
|
|
|
end |
|
43
|
|
|
|