mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add site preference for standard subjects, including support for Re
This commit is contained in:
@@ -40,8 +40,16 @@ module Email
|
||||
end
|
||||
|
||||
def subject
|
||||
subject = @opts[:subject]
|
||||
subject = I18n.t("#{@opts[:template]}.subject_template", template_args) if @opts[:template]
|
||||
if @opts[:use_site_subject]
|
||||
subject = String.new(SiteSetting.email_subject)
|
||||
subject.gsub!("%{site_name}", @template_args[:site_name])
|
||||
subject.gsub!("%{optional_re}", @opts[:add_re_to_subject] ? I18n.t('subject_re', template_args) : '')
|
||||
subject.gsub!("%{optional_pm}", @opts[:private_reply] ? I18n.t('subject_pm', template_args) : '')
|
||||
subject.gsub!("%{topic_title}", @template_args[:topic_title]) if @template_args[:topic_title] # must be last for safety
|
||||
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