Skip to content

Commit a5031cc

Browse files
committed
Issues-505: updated emails(discussions/comments)
1 parent be5f62d commit a5031cc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

class.groups.plugin.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,14 @@ public function discussionModel_beforeRecordAdvancedNotification_handler($sender
603603
if($groupName) {
604604
$headline = sprintf('%s: %s', $groupName, $headline);
605605
}
606-
$data["HeadlineFormat"] = $headline;
606+
$data['HeadlineFormat'] = $headline;
607+
$data['ActionText'] = 'Open Discussion';
607608
// Format to Html
608609
$message = Gdn::formatService()->renderQuote($discussion['Body'], $discussion['Format']);
609610
// We just converted it to HTML. Make sure everything downstream knows it.
610611
// Taking this HTML and feeding it into the Rich Format for example, would be invalid.
611612
$data['Format'] = 'Html';
612-
$data["Story"] =
613+
$data['Story'] =
613614
'<p>You are watching the category "' . $categoryName . '", ' .
614615
'which was updated ' . $dateInserted . ' by ' . $author->Name . ':<p/>' .
615616
'<hr/>' .
@@ -657,15 +658,16 @@ public function commentModel_beforeRecordAdvancedNotification($sender, $args){
657658
if($groupName) {
658659
$headline = sprintf('%s: %s', $groupName, $headline);
659660
}
660-
$data["HeadlineFormat"] = $headline;
661+
$data['ActionText'] = 'Open Discussion';
662+
$data['HeadlineFormat'] = $headline;
661663
// $data["HeadlineFormat"] = 'The new discussion has been posted in the category ' . $categoryName . '.';
662664
// Format to Html
663665
$discussionStory = condense(Gdn_Format::to($discussion['Body'], $discussion['Format']));
664666
$commentStory = Gdn::formatService()->renderQuote($comment['Body'],$comment['Format']);
665667
// We just converted it to HTML. Make sure everything downstream knows it.
666668
// Taking this HTML and feeding it into the required format for example, would be invalid.
667669
$data['Format'] = 'Html';
668-
$data["Story"] =
670+
$data['Story'] =
669671
'<p>You are watching the discussion "' . $discussionName . '" in the category "' .$categoryName.'" '.
670672
'which was updated ' . $commentDateInserted . ' by ' . $commentAuthor->Name . ':</p>' .
671673
'<hr/>' .
@@ -696,7 +698,8 @@ private function buildEmailGroupLink($group) {
696698
$groupName = $group->Name;
697699
$groupType = ucfirst(self::UI[$group->Type]['TypeName']);
698700
$color = c('Garden.EmailTemplate.ButtonTextColor');
699-
return sprintf('<span>%s: %s </span><br/>', $groupType, anchor($groupName, url(GroupsPlugin::GROUP_ROUTE . $group->GroupID, true), '',
701+
$url = $group->ChallengeUrl? url($group->ChallengeUrl, true) : url(GroupsPlugin::GROUP_ROUTE . $group->GroupID, true);
702+
return sprintf('<span>%s: %s </span><br/>', $groupType, anchor($groupName, $url, '',
700703
['rel' => 'noopener noreferrer', 'target' => '_blank', 'style' => 'color:' . $color]));
701704
}
702705
return '';

0 commit comments

Comments
 (0)