Add notification for comments please

Created on 28 May 2023, about 1 year ago
Updated 7 June 2024, 22 days ago

Hi,

it would be great if u can add the notification for drupal comments too. I think its not a big deal just two more hooks like this:

/**
* Implements hook_comment_insert().
*/
function admin_content_notification_comment_insert(EntityInterface $comment) {
if (\Drupal::service('admin_content_notification.common')->isCurrentUserRoleAllowedToSendNotification()) {
$node = $comment->getCommentedEntity();
\Drupal::service('admin_content_notification.common')->sendMail($node, FALSE, $comment);
}
}

/**
* Implements hook_comment_update().
*/
function admin_content_notification_comment_update(EntityInterface $comment) {
if (!empty(\Drupal::config('admin_content_notification.settings')->get('admin_content_notification_trigger_on_comment_update')) && \Drupal::service('admin_content_notification.common')->isCurrentUserRoleAllowedToSendNotification()) {
$node = $comment->getCommentedEntity();
\Drupal::service('admin_content_notification.common')->sendMail($node, FALSE, $comment);
}
}

But what i dont know how to get the tokens for the email (comment body etc.).

It would be great, because this module is great and i dont want another one for admin comment notifications

✨ Feature request
Status

Needs review

Version

4.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany vgutekunst

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024