Skip to content

Commit 4dbce4b

Browse files
authored
Merge pull request #113 from topcoder-platform/issues-670
Use a new email template for Client Manager
2 parents c66e711 + 5d7d277 commit 4dbce4b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Topcoder/class.topcoder.plugin.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2388,7 +2388,7 @@ public function profileController_preferences_create($sender, $userReference = '
23882388
$sender->render();
23892389
}
23902390

2391-
// All notified users have been added in an activity
2391+
// All notified users have been added in an activity. This called before adding an activity in an activity Queue and sending+saving it in DB
23922392
public function activityModel_BeforeCheckPreference_handler($sender, $args) {
23932393
$activity = &$args['Data'];
23942394
$notifyUserID = val('NotifyUserID', $activity);
@@ -2405,11 +2405,23 @@ public function activityModel_BeforeCheckPreference_handler($sender, $args) {
24052405
$isClientManager = count(array_intersect($currentProjectRoles, ["client manager"])) > 0;
24062406
if($isClientManager) {
24072407
$activity['Data']['EmailUrl'] = val('EmbedUrl',$data);
2408+
$activity['Data']['EmailTemplate'] = 'email-selfservice';
2409+
$category = CategoryModel::categories($challengeID);
2410+
$categoryName = val('Name', $category);
2411+
$headline = 'Message From a Topcoder Member on Your Work - Please See';
2412+
$activity['HeadlineFormat'] = $headline;
2413+
$activity['Headline'] = $headline;
2414+
$activity['Story']= sprintf('A new message has been posted on your work forum tied to your Topcoder Work "%s". You can read the full message below.<br/>
2415+
To answer, click here to be taken to this discussion.<br/>
2416+
Please do not reply to this email.<br/>
2417+
Thank you!
2418+
The Topcoder Team', $categoryName);
24082419
return;
24092420
}
24102421
}
24112422
}
24122423
$activity['Data']['EmailUrl'] = externalUrl(val('Route', $activity) == '' ? '/' : val('Route', $activity));
2424+
$activity['Data']['EmailTemplate'] = 'email-basic';
24132425
}
24142426
}
24152427

0 commit comments

Comments
 (0)