mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-03-16 06:13:34 +00:00
Fix #9358 - Meeting invite notification emails not sending to all invitees.
This commit is contained in:
parent
77bf446337
commit
9cbd35d351
2 changed files with 10 additions and 3 deletions
|
@ -419,6 +419,12 @@ class SugarBean
|
|||
*/
|
||||
public $createdAuditRecords;
|
||||
|
||||
/**
|
||||
* Keeps track of emails sent to notify_user ids to avoid duplicate emails
|
||||
* @var array $sentAssignmentNotifications
|
||||
*/
|
||||
public $sentAssignmentNotifications = array();
|
||||
|
||||
/**
|
||||
* SugarBean constructor.
|
||||
* Performs following tasks:
|
||||
|
@ -3187,7 +3193,7 @@ class SugarBean
|
|||
{
|
||||
global $current_user;
|
||||
|
||||
if ((($this->object_name == 'Meeting' || $this->object_name == 'Call') || $notify_user->receive_notifications) && !$this->sentAssignmentNotifications) {
|
||||
if ((($this->object_name == 'Meeting' || $this->object_name == 'Call') || $notify_user->receive_notifications) && !in_array($notify_user->id, $this->sentAssignmentNotifications, true)) {
|
||||
$sendToEmail = $notify_user->emailAddress->getPrimaryAddress($notify_user);
|
||||
$sendEmail = true;
|
||||
if (empty($sendToEmail)) {
|
||||
|
@ -3252,7 +3258,7 @@ class SugarBean
|
|||
$GLOBALS['log']->fatal("Notifications: error sending e-mail (method: {$notify_mail->Mailer}), " .
|
||||
"(error: {$notify_mail->ErrorInfo})");
|
||||
} else {
|
||||
$this->sentAssignmentNotifications = true;
|
||||
$this->sentAssignmentNotifications[] = $notify_user->id;
|
||||
$GLOBALS['log']->info("Notifications: e-mail successfully sent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,7 +241,8 @@ class MeetingTest extends SuitePHPUnitFrameworkTestCase
|
|||
|
||||
$meeting->date_start = '2016-02-11 17:30:00';
|
||||
$meeting->date_end = '2016-02-11 17:30:00';
|
||||
$meeting->sentAssignmentNotifications = false;
|
||||
$meeting->sentAssignmentNotifications = [];
|
||||
$meeting->sentAssignmentNotifications[] = $notify_user->id;
|
||||
|
||||
$admin = BeanFactory::newBean('Administration');
|
||||
$admin->retrieveSettings();
|
||||
|
|
Loading…
Reference in a new issue