Do not notify user if not set in the params
authorjitendrapurohit <jitendra@fuzion.co.nz>
Tue, 21 Sep 2021 04:29:37 +0000 (09:59 +0530)
committerjitendrapurohit <jitendra@fuzion.co.nz>
Wed, 22 Sep 2021 12:02:57 +0000 (17:32 +0530)
CRM/Utils/System/Drupal8.php

index a1ef60ee45fb4d66daff3039b7085e308bcd4331..06db4707141284d712b0bd74a149d1154a8ad088 100644 (file)
@@ -82,10 +82,11 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
     //      self-registers.
     //    - 'register_pending_approval': Welcome message, user pending admin
     //      approval.
-    // @Todo: Should we only send off emails if $params['notify'] is set?
     switch (TRUE) {
       case $user_register_conf == 'admin_only' || $user->isAuthenticated():
-        _user_mail_notify('register_admin_created', $account);
+        if (!empty($params['notify'])) {
+          _user_mail_notify('register_admin_created', $account);
+        }
         break;
 
       case $user_register_conf == 'visitors':