FIX: Use correct URL for unsubscribe (#10077)
This commit is contained in:
parent
9ffc022cf4
commit
75151f0457
|
@ -9,6 +9,6 @@ class SubscriptionMailer < ActionMailer::Base
|
|||
template: "unsubscribe_mailer",
|
||||
site_title: SiteSetting.title,
|
||||
site_domain_name: Discourse.current_hostname,
|
||||
confirm_unsubscribe_link: "#{Discourse.base_url}/unsubscribe/#{unsubscribe_key}"
|
||||
confirm_unsubscribe_link: email_unsubscribe_url(unsubscribe_key, host: Discourse.base_url)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe SubscriptionMailer do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
subject { SubscriptionMailer.confirm_unsubscribe(user) }
|
||||
|
||||
it "contains the right URL" do
|
||||
expect(subject.body).to include("#{Discourse.base_url}/email/unsubscribe/#{UnsubscribeKey.last.key}")
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue