diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb
index ab71e381f23..5981e879699 100644
--- a/app/mailers/user_notifications.rb
+++ b/app/mailers/user_notifications.rb
@@ -192,10 +192,12 @@ class UserNotifications < ActionMailer::Base
end
end
+ top = SiteContent.content_for(:notification_email_top)
+
html = UserNotificationRenderer.new(Rails.configuration.paths["app/views"]).render(
template: 'email/notification',
format: :html,
- locals: { context_posts: context_posts, post: post }
+ locals: { context_posts: context_posts, post: post, top: top ? PrettyText.cook(top).html_safe : nil }
)
template = "user_notifications.user_#{notification_type}"
diff --git a/app/models/site_content.rb b/app/models/site_content.rb
index 000495f662f..c346be4153c 100644
--- a/app/models/site_content.rb
+++ b/app/models/site_content.rb
@@ -24,6 +24,7 @@ class SiteContent < ActiveRecord::Base
add_content_type :top, allow_blank: true, format: :html
add_content_type :bottom, allow_blank: true, format: :html
add_content_type :head, allow_blank: true, format: :html
+ add_content_type :notification_email_top, allow_blank: true, format: :markdown
def site_content_type
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
diff --git a/app/views/email/notification.html.erb b/app/views/email/notification.html.erb
index ef1e3afbc0e..8108cc693f6 100644
--- a/app/views/email/notification.html.erb
+++ b/app/views/email/notification.html.erb
@@ -1,4 +1,10 @@
+
+<% if top.present? %>
+
<%= top %>
+
+<% end %>
+
<%= render :partial => 'email/post', :locals => {:post => post} %>
<% if context_posts.present? %>
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 54ecbd5f726..1876b64f643 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -578,6 +578,9 @@ en:
tos_signup_form_message:
title: "Signup Form: Terms of Service Message"
description: "The message that will appear beside a checkbox on the signup form if the tos_accept_required site setting is enabled."
+ notification_email_top:
+ title: "Notification Email Top"
+ description: "A message that will be displayed at the top of all notification emails."
site_settings:
default_locale: "The default language of this Discourse instance (ISO 639-1 Code)"