From c43ea776389b5f01e7185963a68eb6a69b4a8f9d Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 16 Mar 2020 17:30:05 +0000 Subject: [PATCH] Respect 'Donot notify activity type' setting --- CRM/Case/Form/Activity.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index 623e8d0a07..f6c12e01de 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -601,8 +601,16 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { $mailStatus = ts("A copy of the activity has also been sent to selected contact(s)."); } else { - $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames([$vval['actId']], TRUE, FALSE); - $mailStatus .= ' ' . ts("A copy of the activity has also been sent to assignee contact(s)."); + $actTypeId = civicrm_api3('Activity', 'getvalue', [ + 'return' => 'activity_type_id', + 'id' => $vval['actId'], + ]); + if (!in_array($actTypeId, Civi::settings()->get('do_not_notify_assignees_for'))) { + $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames( + [$vval['actId']], TRUE, FALSE + ); + $mailStatus .= ' ' . ts("A copy of the activity has also been sent to assignee contact(s)."); + } } //build an associative array with unique email addresses. foreach ($params[$val] as $key => $value) { -- 2.25.1