2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-01-20 03:25:25 -06:00
|
|
|
class SubscriptionMailer < ActionMailer::Base
|
|
|
|
include Email::BuildEmailHelper
|
|
|
|
|
2017-07-27 20:20:09 -05:00
|
|
|
def confirm_unsubscribe(user, opts = {})
|
2016-06-16 20:27:52 -05:00
|
|
|
unsubscribe_key = UnsubscribeKey.create_key_for(user, "all")
|
2016-01-20 03:25:25 -06:00
|
|
|
build_email user.email,
|
|
|
|
template: "unsubscribe_mailer",
|
|
|
|
site_title: SiteSetting.title,
|
|
|
|
site_domain_name: Discourse.current_hostname,
|
2020-06-24 02:31:20 -05:00
|
|
|
confirm_unsubscribe_link: email_unsubscribe_url(unsubscribe_key, host: Discourse.base_url)
|
2016-01-20 03:25:25 -06:00
|
|
|
end
|
|
|
|
end
|