🚀 synchronize events if unknown event id is transmitted
This commit is contained in:
parent
33a733c3d2
commit
ebf0e21287
1 changed files with 11 additions and 1 deletions
|
@ -141,7 +141,17 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
|||
['event_id' => $apiRequest['params']['custom_fields']['event']]
|
||||
);
|
||||
} catch (CiviCRM_API3_Exception $e) {
|
||||
// Do nothing
|
||||
// If no event was found, sync all Events and try it again
|
||||
try {
|
||||
$test = civicrm_api3('TwingleEvent', 'sync');
|
||||
$targetCampaign = civicrm_api3(
|
||||
'TwingleEvent',
|
||||
'getsingle',
|
||||
['event_id' => $apiRequest['params']['custom_fields']['event']]
|
||||
);
|
||||
} catch (CiviCRM_API3_Exception $e) {
|
||||
// there's nothing left to do
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue