mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 21:04:33 +08:00
FIX: Keep original subject in emails to staged users
Renaming a topic shouldn't be visibile to staged users when the topic was created via email.
This commit is contained in:
@ -65,14 +65,18 @@ module Email
|
||||
if @opts[:use_site_subject]
|
||||
subject = String.new(SiteSetting.email_subject)
|
||||
subject.gsub!("%{site_name}", @template_args[:email_prefix])
|
||||
subject.gsub!("%{optional_re}", @opts[:add_re_to_subject] ? I18n.t('subject_re', @template_args) : '')
|
||||
subject.gsub!("%{optional_re}", @opts[:add_re_to_subject] ? I18n.t('subject_re') : '')
|
||||
subject.gsub!("%{optional_pm}", @opts[:private_reply] ? @template_args[:subject_pm] : '')
|
||||
subject.gsub!("%{optional_cat}", @template_args[:show_category_in_subject] ? "[#{@template_args[:show_category_in_subject]}] " : '')
|
||||
subject.gsub!("%{optional_tags}", @template_args[:show_tags_in_subject] ? "#{@template_args[:show_tags_in_subject]} " : '')
|
||||
subject.gsub!("%{topic_title}", @template_args[:topic_title]) if @template_args[:topic_title] # must be last for safety
|
||||
elsif @opts[:use_topic_title_subject]
|
||||
subject = @opts[:add_re_to_subject] ? I18n.t('subject_re') : ''
|
||||
subject = "#{subject}#{@template_args[:topic_title]}"
|
||||
elsif @opts[:template]
|
||||
subject = I18n.t("#{@opts[:template]}.subject_template", @template_args)
|
||||
else
|
||||
subject = @opts[:subject]
|
||||
subject = I18n.t("#{@opts[:template]}.subject_template", @template_args) if @opts[:template]
|
||||
end
|
||||
subject
|
||||
end
|
||||
|
Reference in New Issue
Block a user