mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:44:30 -04:00
Updates for postmark webhook processing
This commit is contained in:
parent
bb706a654a
commit
d00730bc8b
@ -359,6 +359,20 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
|
||||
$postmark = new PostmarkClient($postmark_secret);
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($message_id);
|
||||
|
||||
|
||||
try {
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($message_id);
|
||||
} catch(\Exception $e) {
|
||||
|
||||
$postmark_secret = config('services.postmark-outlook.token');
|
||||
$postmark = new PostmarkClient($postmark_secret);
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($message_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $messageDetail;
|
||||
|
||||
}
|
||||
@ -391,7 +405,17 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
$postmark_secret = !empty($this->company->settings->postmark_secret) ? $this->company->settings->postmark_secret : config('services.postmark.token');
|
||||
|
||||
$postmark = new PostmarkClient($postmark_secret);
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($this->request['MessageID']);
|
||||
|
||||
try {
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($this->request['MessageID']);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
$postmark_secret = config('services.postmark-outlook.token');
|
||||
$postmark = new PostmarkClient($postmark_secret);
|
||||
$messageDetail = $postmark->getOutboundMessageDetails($this->request['MessageID']);
|
||||
|
||||
}
|
||||
|
||||
$recipients = collect($messageDetail['recipients'])->flatten()->implode(',');
|
||||
$subject = $messageDetail->subject ?? '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user