2016-01-20 04:25:25 -05:00
|
|
|
require_dependency 'email/message_builder'
|
|
|
|
|
|
|
|
class SubscriptionMailer < ActionMailer::Base
|
|
|
|
include Email::BuildEmailHelper
|
|
|
|
|
|
|
|
def confirm_unsubscribe(user, opts={})
|
2016-06-16 21:27:52 -04:00
|
|
|
unsubscribe_key = UnsubscribeKey.create_key_for(user, "all")
|
2016-01-20 04:25:25 -05:00
|
|
|
build_email user.email,
|
|
|
|
template: "unsubscribe_mailer",
|
|
|
|
site_title: SiteSetting.title,
|
|
|
|
site_domain_name: Discourse.current_hostname,
|
2016-06-16 21:27:52 -04:00
|
|
|
confirm_unsubscribe_link: "#{Discourse.base_url}/unsubscribe/#{unsubscribe_key}"
|
2016-01-20 04:25:25 -05:00
|
|
|
end
|
|
|
|
end
|