Expand the list of "cc" for a conversation before sending it
This commit is contained in:
parent
4a3410de81
commit
39372e1439
1 changed files with 9 additions and 3 deletions
|
@ -109,10 +109,16 @@ class MMFCustomersGroupsServiceProvider extends ServiceProvider {
|
|||
$emails = new Collection;
|
||||
foreach ( $groups as $group_id ) {
|
||||
$group = CustomersGroup::find($group_id);
|
||||
$emails->concat($group->emails());
|
||||
$emails = $emails->concat($group->emails());
|
||||
}
|
||||
$emails = $emails->unique();
|
||||
// TODO: Update $conversation to include this list of e-mails.
|
||||
$emails = $emails->unique('email')->pluck('email');
|
||||
// Update the list of cc emails.
|
||||
$cc = array_unique(array_merge(
|
||||
$conversation->getCcArray(),
|
||||
$emails->toArray()
|
||||
));
|
||||
$conversation->setCc($cc);
|
||||
$conversation->save();
|
||||
}, 20, 2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue