2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
class DeviseMailer < Devise::Mailer
|
|
|
|
default from: "#{Gitlab.config.gitlab.email_display_name} <#{Gitlab.config.gitlab.email_from}>"
|
|
|
|
default reply_to: Gitlab.config.gitlab.email_reply_to
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
layout 'mailer/devise'
|
|
|
|
|
|
|
|
helper EmailsHelper
|
2019-09-04 21:01:54 +05:30
|
|
|
helper ApplicationHelper
|
2016-11-03 12:29:30 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
def password_change_by_admin(record, opts = {})
|
|
|
|
devise_mail(record, :password_change_by_admin, opts)
|
|
|
|
end
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
def user_admin_approval(record, opts = {})
|
|
|
|
devise_mail(record, :user_admin_approval, opts)
|
|
|
|
end
|
|
|
|
|
2023-03-17 16:20:25 +05:30
|
|
|
def reset_password_instructions(record, token, opts = {})
|
|
|
|
headers['X-Mailgun-Suppressions-Bypass'] = 'true'
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
protected
|
|
|
|
|
|
|
|
def subject_for(key)
|
2018-11-20 20:47:30 +05:30
|
|
|
subject = [super]
|
|
|
|
subject << Gitlab.config.gitlab.email_subject_suffix if Gitlab.config.gitlab.email_subject_suffix.present?
|
|
|
|
|
|
|
|
subject.join(' | ')
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|