✨ include email_id in group membership
This commit is contained in:
parent
8dab2377f5
commit
5a424771fd
5 changed files with 86 additions and 13 deletions
|
@ -340,8 +340,7 @@ class ADGroupMailingList extends GroupMailingList {
|
|||
* @throws \Civi\Mailinglistsync\Exceptions\MailinglistException
|
||||
*/
|
||||
public
|
||||
static function syncContacts($recipients
|
||||
): array {
|
||||
static function syncContacts($recipients): array {
|
||||
$results = [];
|
||||
|
||||
foreach ($recipients as $contact) {
|
||||
|
@ -471,12 +470,13 @@ class ADGroupMailingList extends GroupMailingList {
|
|||
* @return array|array[]
|
||||
*/
|
||||
private
|
||||
function addRecipient(int $contactId
|
||||
): array {
|
||||
function addRecipient(int $contactId): array {
|
||||
$result = [];
|
||||
// Add the contact to the group
|
||||
try {
|
||||
$this->addContactToGroup($contactId);
|
||||
$contactEmail = MailingListRecipient::getContactById($contactId)
|
||||
->getEmailId(self::LOCATION_TYPE);
|
||||
$this->addContactToGroup($contactId, $contactEmail);
|
||||
$result['added'] = TRUE;
|
||||
}
|
||||
catch (MailinglistException $e) {
|
||||
|
@ -496,8 +496,7 @@ class ADGroupMailingList extends GroupMailingList {
|
|||
* @return array
|
||||
*/
|
||||
public
|
||||
function removeRecipient(MailingListRecipient $recipient
|
||||
): array {
|
||||
function removeRecipient(MailingListRecipient $recipient): array {
|
||||
$result = [
|
||||
'sid' => $recipient->getSid(),
|
||||
'contact_id' => $recipient->getContactId(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue