Skip to content
Snippets Groups Projects
Commit 5a5274a5 authored by Urvashi Vora's avatar Urvashi Vora Committed by Ilcho Vuchkov
Browse files

Issue #3373798 by urvashi_vora, vuil: Fix the issues reported by phpcs

parent 3006fec8
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
/**
* @file
* Primary module hooks for Content Update Email Sending module.
* Hooks implementation for the Content Update Email Sending module.
*/
use Drupal\Core\Entity\EntityInterface;
......@@ -39,13 +39,19 @@ function content_update_email_sending_mail($key, &$message, $params) {
case 'created':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('New content created: @title', ['@title' => $params['title']], $options);
$message['body'][] = t("New content has been added to the website: :link by user ':user'", [':link' => $params['link'], ':user' => $params['user']]);
$message['body'][] = t("New content has been added to the website: :link by user ':user'", [
':link' => $params['link'],
':user' => $params['user'],
]);
break;
case 'updated':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Content was updated: @title', ['@title' => $params['title']], $options);
$message['body'][] = t("Content has been updated in the website: :link by user ':user'", [':link' => $params['link'], ':user' => $params['user']]);
$message['body'][] = t("Content has been updated in the website: :link by user ':user'", [
':link' => $params['link'],
':user' => $params['user'],
]);
break;
}
}
......@@ -54,10 +60,9 @@ function content_update_email_sending_mail($key, &$message, $params) {
* Prepare and send an email if conditions met.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
*
* Entity Interface.
* @param string $key
*
* @return void
* Key.
*/
function _content_update_email_sending_prepare_email(EntityInterface $entity, $key) {
$config = \Drupal::config('content_update_email_sending.settings');
......@@ -72,14 +77,14 @@ function _content_update_email_sending_prepare_email(EntityInterface $entity, $k
return;
}
/* @var \Drupal\user\Entity\User $actor */
/** @var \Drupal\user\Entity\User $actor */
$actor = Drupal::currentUser();
/*$roles = $actor->getRoles();
// Don't send emails for changes by content_editor and review_editor.
$ignored_roles = ['content_editor', 'review_editor'];
$dont_notify = !empty(array_intersect($roles, $ignored_roles));
if ($dont_notify) {
return;
return;
}*/
$mailManager = \Drupal::service('plugin.manager.mail');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment