discourse/app/mailers/subscription_mailer.rb

15 lines
525 B
Ruby
Raw Normal View History

2016-01-20 17:25:25 +08:00
require_dependency 'email/message_builder'
class SubscriptionMailer < ActionMailer::Base
include Email::BuildEmailHelper
2017-07-28 09:20:09 +08:00
def confirm_unsubscribe(user, opts = {})
unsubscribe_key = UnsubscribeKey.create_key_for(user, "all")
2016-01-20 17:25:25 +08:00
build_email user.email,
template: "unsubscribe_mailer",
site_title: SiteSetting.title,
site_domain_name: Discourse.current_hostname,
confirm_unsubscribe_link: "#{Discourse.base_url}/unsubscribe/#{unsubscribe_key}"
2016-01-20 17:25:25 +08:00
end
end