Skip to content

Commit

Permalink
Add requesting User's surname to emails
Browse files Browse the repository at this point in the history
- for clarity, as the email could be someone outside their entity.
- i.e, a Site role request email going to someone with a role
  over an NGI.
  • Loading branch information
gregcorbett committed Oct 1, 2021
1 parent 4b60518 commit 35e5cf5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Gocdb_Services/NotificationService.php
Expand Up @@ -109,23 +109,26 @@ private function getWebPortalURL() {

private function sendEmail($roleRequested, $requestingUser, $entityName, $approvingUser) {
$subject = sprintf(
'GOCDB: A Role request from %1$s over %2$s requires your attention',
'GOCDB: A Role request from %1$s %2$s over %3$s requires your attention',
$requestingUser->getForename(),
$requestingUser->getSurname(),
$roleRequested->getOwnedEntity()->getName()
);

$body = sprintf(
implode("\n", array(
'Dear %1$s,',
'%2$s requested %3$s on %4$s which requires your attention.',
'',
'%2$s %3$s requested the "%4$s" role over %5$s which requires your attention.',
'',
'You can approve or deny the request here:',
' %5$s/index.php?Page_Type=Role_Requests',
' %6$s/index.php?Page_Type=Role_Requests',
'',
'Note: This role could already have been approved or denied by another GOCDB User',
)),
$approvingUser->getForename(),
$requestingUser->getForename(),
$requestingUser->getSurname(),
$roleRequested->getRoleType()->getName(),
$roleRequested->getOwnedEntity()->getName(),
$this->getWebPortalURL()
Expand Down

0 comments on commit 35e5cf5

Please sign in to comment.