Skip to content

Use a new email template for Client Manager #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Topcoder/class.topcoder.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ public function profileController_preferences_create($sender, $userReference = '
$sender->render();
}

// All notified users have been added in an activity
// 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
public function activityModel_BeforeCheckPreference_handler($sender, $args) {
$activity = &$args['Data'];
$notifyUserID = val('NotifyUserID', $activity);
Expand All @@ -2405,11 +2405,23 @@ public function activityModel_BeforeCheckPreference_handler($sender, $args) {
$isClientManager = count(array_intersect($currentProjectRoles, ["client manager"])) > 0;
if($isClientManager) {
$activity['Data']['EmailUrl'] = val('EmbedUrl',$data);
$activity['Data']['EmailTemplate'] = 'email-selfservice';
$category = CategoryModel::categories($challengeID);
$categoryName = val('Name', $category);
$headline = 'Message From a Topcoder Member on Your Work - Please See';
$activity['HeadlineFormat'] = $headline;
$activity['Headline'] = $headline;
$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/>
To answer, click here to be taken to this discussion.<br/>
Please do not reply to this email.<br/>
Thank you!
The Topcoder Team', $categoryName);
return;
}
}
}
$activity['Data']['EmailUrl'] = externalUrl(val('Route', $activity) == '' ? '/' : val('Route', $activity));
$activity['Data']['EmailTemplate'] = 'email-basic';
}
}

Expand Down