mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
First Try: Include Post History (context) in Notification Emails
This commit is contained in:
parent
112b9f9c2a
commit
3e7b418ea8
6 changed files with 57 additions and 13 deletions
|
@ -37,6 +37,9 @@ module Email
|
|||
body renderer.html
|
||||
end
|
||||
|
||||
@message.parts[0].body = @message.parts[0].body.to_s.gsub!(/\[\/?email-indent\]/, '')
|
||||
|
||||
|
||||
@message.text_part.content_type = 'text/plain; charset=UTF-8'
|
||||
|
||||
# Set up the email log
|
||||
|
|
|
@ -22,11 +22,16 @@ module Email
|
|||
if img['src'][0] == "/"
|
||||
img['src'] = "#{Discourse.base_url}#{img['src']}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@fragment.css('div.post-indent').each do |div|
|
||||
div['style'] = 'margin-left: 15px; margin-top: 20px; max-width: 694px;'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def format_html
|
||||
|
||||
@fragment.css('h3').each do |h3|
|
||||
h3['style'] = 'margin: 15px 0 20px 0; border-bottom: 1px solid #ddd;'
|
||||
end
|
||||
|
@ -55,10 +60,14 @@ module Email
|
|||
@fragment.css('div.digest-post').each do |div|
|
||||
div['style'] = 'margin-left: 15px; margin-top: 20px; max-width: 694px;'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def to_html
|
||||
@fragment.to_html
|
||||
result = @fragment.to_html
|
||||
result.gsub!(/\[email-indent\]/, "<div style='margin-left: 15px'>")
|
||||
result.gsub!(/\[\/email-indent\]/, "</div>")
|
||||
result
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue