Improve email messages.
parent
3e527de407
commit
2f0aff3f95
|
@ -44,12 +44,12 @@ function yufu_admin_mail($key, &$message, $params) {
|
||||||
break;
|
break;
|
||||||
case 'concept_approved':
|
case 'concept_approved':
|
||||||
$message['from'] = \Drupal::config('system.site')->get('mail');
|
$message['from'] = \Drupal::config('system.site')->get('mail');
|
||||||
$message['subject'] = t('[YUFU] Your concept (changes) were approved: @title', ['@title' => $params['node_title']], $options);
|
$message['subject'] = t('[YUFU] Concept changes approved: @title', ['@title' => $params['node_title']], $options);
|
||||||
$message['body'][] = $params['message'];
|
$message['body'][] = $params['message'];
|
||||||
break;
|
break;
|
||||||
case 'concept_rejected':
|
case 'concept_rejected':
|
||||||
$message['from'] = \Drupal::config('system.site')->get('mail');
|
$message['from'] = \Drupal::config('system.site')->get('mail');
|
||||||
$message['subject'] = t('[YUFU] Your concept (changes) were rejected: @title', ['@title' => $params['node_title']], $options);
|
$message['subject'] = t('[YUFU] Concept changes rejected: @title', ['@title' => $params['node_title']], $options);
|
||||||
$message['body'][] = $params['message'];
|
$message['body'][] = $params['message'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,10 +127,18 @@ function _yufu_admin_get_node_transition(NodeInterface $node) {
|
||||||
*/
|
*/
|
||||||
function _yufu_admin_concept_drafted_mail(NodeInterface $node) {
|
function _yufu_admin_concept_drafted_mail(NodeInterface $node) {
|
||||||
$to = _yufu_admin_get_all_editors_emails();
|
$to = _yufu_admin_get_all_editors_emails();
|
||||||
|
if ($node->isNew()) {
|
||||||
$params['message'] = t('New concept created: @title - @url', [
|
$params['message'] = t('New concept created: @title - @url', [
|
||||||
'@title' => $node->getTitle(),
|
'@title' => $node->getTitle(),
|
||||||
'@url' => !$node->isNew() ? $node?->toUrl()?->toString() : '',
|
'@url' => !$node->isNew() ? $node?->toUrl()?->toString() : '',
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$params['message'] = t('New changes to concept proposed: @title - @url', [
|
||||||
|
'@title' => $node->getTitle(),
|
||||||
|
'@url' => !$node->isNew() ? $node?->toUrl()?->toString() : '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
$params['node_title'] = $node->getTitle();
|
$params['node_title'] = $node->getTitle();
|
||||||
$params['to'] = implode(',', $to);
|
$params['to'] = implode(',', $to);
|
||||||
return $params;
|
return $params;
|
||||||
|
@ -220,8 +228,7 @@ function _yufu_admin_concept_approved_get_message(NodeInterface $node) {
|
||||||
// @TODO - to make this work properly, we should get a list of all authors of
|
// @TODO - to make this work properly, we should get a list of all authors of
|
||||||
// unpublished revisions so far since the last published revision.
|
// unpublished revisions so far since the last published revision.
|
||||||
if ($to = _yufu_admin_get_pioneer_email($node)) {
|
if ($to = _yufu_admin_get_pioneer_email($node)) {
|
||||||
// @TODO Dodamo se avtorja v sporocilo?
|
$params['message'] = t('Your proposal of changes to concept were approved: @title - @url', [
|
||||||
$params['message'] = t('New concept created: @title - @url', [
|
|
||||||
'@title' => $node->getTitle(),
|
'@title' => $node->getTitle(),
|
||||||
'@url' => $node?->toUrl()?->toString() ?? '',
|
'@url' => $node?->toUrl()?->toString() ?? '',
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in New Issue