diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e17fe1..72175551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Release Notes for Campaign ## 2.7.2 - 2023-05-26 +### Changed +- Errors are now logged when syncing users to contacts fail. + ### Fixed - Fixed a bug in which custom field values were not being imported when importing contacts via CSV files ([#390](https://github.com/putyourlightson/craft-campaign/issues/390)). diff --git a/src/services/SyncService.php b/src/services/SyncService.php index ccd00dce..57db2a74 100755 --- a/src/services/SyncService.php +++ b/src/services/SyncService.php @@ -164,6 +164,9 @@ public function syncUserMailingList(User $user, MailingListElement $mailingList) $contact->setFieldValues($user->getFieldValues()); if (!Craft::$app->getElements()->saveElement($contact)) { + $errors = implode('. ', $contact->getErrorSummary(true)); + Campaign::$plugin->log('Couldn’t sync user. {errors}', ['errors' => $errors]); + return; }