Skip to content

Commit

Permalink
refs #39633, add log message on syncall
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Jun 20, 2024
1 parent 8e55688 commit 0b260de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CRM/Mailing/External/SmartMarketing.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract public function parseSavedData($json);
* Sync all smart marketing to remote
*/
public static function syncAll() {
CRM_Core_Error::debug_log_message("Smart Marketing - Syncing Start");
$availableGroupTypes = CRM_Core_OptionGroup::values('group_type');
$typeNames = array();
foreach($availableGroupTypes as $typeId => $typeName) {
Expand All @@ -35,12 +36,15 @@ public static function syncAll() {
$syncResult = array();
foreach($typeNames as $typeId => $class) {
$groups = CRM_Core_PseudoConstant::allGroup($typeId);
CRM_Core_Error::debug_log_message("Smart Marketing - found groups: ".implode(',', $groups));
if (!empty($groups)) {
foreach($groups as $groupId => $groupName) {
// skip synced
if (isset($syncResult[$groupId])) {
CRM_Core_Error::debug_log_message("Smart Marketing - Skipped $groupId");
continue;
}
CRM_Core_Error::debug_log_message("Smart Marketing - Processing $groupId");
$syncResult[$groupId] = self::syncGroup($groupId);
if (!empty($syncResult[$groupId]['result']['#report'])) {
CRM_Core_Error::debug_log_message(implode(' / ', $syncResult[$groupId]['result']['#report']));
Expand All @@ -49,6 +53,7 @@ public static function syncAll() {
}
}
}
CRM_Core_Error::debug_log_message("Smart Marketing - Syncing Complete");
}

/**
Expand Down

0 comments on commit 0b260de

Please sign in to comment.