Skip to content

Commit

Permalink
Merge pull request #4 from UVLabs/development
Browse files Browse the repository at this point in the history
fix: Error when contact not found in mautic
  • Loading branch information
UVLabs authored Jul 6, 2023
2 parents e174028 + f7c13dd commit d4c191e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions includes/Contacts/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public function updateContactTags(array $add_tags = array(), array $remove_tags
{
$email = $this->user_data['email'];
$contact_details = $this->findContactDetailsByEmail($email);
if (empty($contact_details)) {
return 0;
}
$contact_id = $contact_details['id'];
$contact_current_tags = array_column($contact_details['tags'], 'tag');

Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @link https://uriahsvictor.com
* @since 1.0.1
* @license GPLv2
* @version 1.1.2
* @version 1.1.3
*/

use CoachFreem\Contacts\Create as CreateContact;
Expand Down Expand Up @@ -89,6 +89,7 @@ function init(ServerRequestInterface $request): string
$custom_mappings = customContactDataMappings();
$segments = contactSegments();
$tags = contactTags();

$contactCreate->setCustomMappings($custom_mappings)
->setSegments($segments)
->setTags($tags)
Expand Down

0 comments on commit d4c191e

Please sign in to comment.