Commit 93c012f2 authored by Melissa Draper's avatar Melissa Draper

Add pseudoheaders to forums mail messages (bug 882894)

We removed info from the email subject and added it to headers. However
people generally don't see the headers, so this patch adds the info back
as pseudoheaders, while removing duplicate info such as poster name,
topic and time.

Change-Id: I1063c70693e3b6345d41225b8fed53e0c20e7d95
Signed-off-by: default avatarMelissa Draper <melissa@catalyst.net.nz>
parent a2f57d5e
......@@ -72,7 +72,7 @@ $string['edittitle'] = 'Edit forum';
$string['edittopic'] = 'Edit topic';
$string['edittopicsuccess'] = 'Topic edited successfully';
$string['forumname'] = 'Forum Name';
$string['forumposthtmltemplate'] = "<div style=\"padding: 0.5em 0; border-bottom: 1px solid #999;\"><strong>%s by %s</strong><br>%s</div>
$string['forumposthtmltemplate'] = "<div style=\"padding: 0.5em 0; border-bottom: 1px solid #999;\"><strong>Forum: %s (%s)</strong></div>
<div style=\"margin: 1em 0;\">%s</div>
......@@ -80,8 +80,7 @@ $string['forumposthtmltemplate'] = "<div style=\"padding: 0.5em 0; border-bottom
<p><a href=\"%s\">Reply to this post online</a></p>
<p><a href=\"%s\">Unsubscribe from this %s</a></p>
</div>";
$string['forumposttemplate'] = "%s by %s
%s
$string['forumposttemplate'] = "Forum: %s (%s)
------------------------------------------------------------------------
%s
......
......@@ -827,10 +827,11 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$post = $this->temp->post;
$unsubscribeid = $post->{$user->subscribetype . 'id'};
$unsubscribelink = get_config('wwwroot') . 'interaction/forum/unsubscribe.php?' . $user->subscribetype . '=' . $unsubscribeid . '&key=' . $user->unsubscribekey;
$cleanforumname = str_replace('"', "'", strip_tags($post->forumtitle));
$cleangroupname = str_replace('"', "'", strip_tags($post->groupname));
return get_string_from_language($user->lang, 'forumposttemplate', 'interaction.forum',
$post->subject ? $post->subject : get_string_from_language($user->lang, 're', 'interaction.forum', $post->topicsubject),
display_name($post->poster, $user),
$post->posttime,
$cleanforumname,
$cleangroupname,
$post->textbody,
$this->url,
$user->subscribetype,
......@@ -842,10 +843,11 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$post = $this->temp->post;
$unsubscribeid = $post->{$user->subscribetype . 'id'};
$unsubscribelink = get_config('wwwroot') . 'interaction/forum/unsubscribe.php?' . $user->subscribetype . '=' . $unsubscribeid . '&key=' . $user->unsubscribekey;
$cleanforumname = str_replace('"', "'", clean_html($post->forumtitle));
$cleangroupname = str_replace('"', "'", clean_html($post->groupname));
return get_string_from_language($user->lang, 'forumposthtmltemplate', 'interaction.forum',
$post->subject ? hsc($post->subject) : get_string_from_language($user->lang, 're', 'interaction.forum', hsc($post->topicsubject)),
hsc(display_name($post->poster, $user)),
$post->posttime,
$cleanforumname,
$cleangroupname,
$post->htmlbody,
$this->url,
$unsubscribelink,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment