mentions: include mentioner in subject line.
The template looks like this:
Subject:
#{creator_name} mentioned you in a comment on post ##{post_id}
Body:
@#{creator_name} mentioned you in a \"comment\":/posts/#{post_id}#comment-#{id} on post ##{post_id}:
[quote]
#{DText.excerpt(body, "@"+user_name)}
[/quote]
This commit is contained in:
@@ -381,5 +381,12 @@ class DText
|
||||
})
|
||||
)
|
||||
end
|
||||
|
||||
# extract the first paragraph `needle` occurs in.
|
||||
def self.excerpt(dtext, needle)
|
||||
dtext = dtext.gsub(/\r\n|\r|\n/, "\n")
|
||||
excerpt = ActionController::Base.helpers.excerpt(dtext, needle, separator: "\n\n", radius: 1, omission: "")
|
||||
excerpt
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user