Skip to content

Commit

Permalink
Added a default translation to activity emails so people with custom …
Browse files Browse the repository at this point in the history
…domains don't see strange text.
  • Loading branch information
tburry committed Nov 6, 2011
1 parent 6e3a27c commit bc67476
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions applications/dashboard/models/class.activitymodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,14 @@ public function SendNotification($ActivityID, $Story = '', $Force = FALSE) {
$Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline));
$Email->To($User->Email, $User->Name);
//$Email->From(Gdn::Config('Garden.SupportEmail'), Gdn::Config('Garden.SupportName'));
$Email->Message(
sprintf(
$Story == '' ? T('EmailNotification') : T('EmailStoryNotification'),

$Message = sprintf(
$Story == '' ? T('EmailNotification', "%1\$s\n\n%2\$s") : T('EmailStoryNotification', "%3\$s\n\n%2\$s"),
$ActivityHeadline,
ExternalUrl($Activity->Route == '' ? '/' : $Activity->Route),
$Story
)
);
);
$Email->Message($Message);

$Notification = array('ActivityID' => $ActivityID, 'User' => $User, 'Email' => $Email, 'Route' => $Activity->Route, 'Story' => $Story, 'Headline' => $ActivityHeadline, 'Activity' => $Activity);
$this->EventArguments = $Notification;
Expand Down Expand Up @@ -689,15 +689,13 @@ public function QueueNotification($ActivityID, $Story = '', $Position = 'last',
$Email = new Gdn_Email();
$Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline));
$Email->To($User->Email, $User->Name);
//$Email->From(Gdn::Config('Garden.SupportEmail'), Gdn::Config('Garden.SupportName'));
$Email->Message(
sprintf(
$Story == '' ? T('EmailNotification') : T('EmailStoryNotification'),
$Message = sprintf(
$Story == '' ? T('EmailNotification', "%1\$s\n\n%2\$s") : T('EmailStoryNotification', "%3\$s\n\n%2\$s"),
$ActivityHeadline,
ExternalUrl($Activity->Route == '' ? '/' : $Activity->Route, TRUE),
ExternalUrl($Activity->Route == '' ? '/' : $Activity->Route),
$Story
)
);
);
$Email->Message($Message);
if (!array_key_exists($User->UserID, $this->_NotificationQueue))
$this->_NotificationQueue[$User->UserID] = array();

Expand Down

0 comments on commit bc67476

Please sign in to comment.