mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 15:13:29 +01:00
fixes
This commit is contained in:
parent
2a28d8c976
commit
5ecb2033db
@ -162,23 +162,23 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
|
||||
// download file and save to tmp dir
|
||||
if (!empty($company_brevo_secret)) {
|
||||
|
||||
$attachment = null;
|
||||
$data = null;
|
||||
try {
|
||||
|
||||
$brevo = new InboundParsingApi(null, Configuration::getDefaultConfiguration()->setApiKey("api-key", $company_brevo_secret));
|
||||
$attachment = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]);
|
||||
$data = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]);
|
||||
|
||||
} catch (\Error $e) {
|
||||
if (config('services.brevo.secret')) {
|
||||
nlog("[ProcessBrevoInboundWebhook] Error while downloading with company credentials, we try to use default credentials now...");
|
||||
|
||||
$brevo = new InboundParsingApi(null, Configuration::getDefaultConfiguration()->setApiKey("api-key", config('services.brevo.secret')));
|
||||
$attachment = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]);
|
||||
$data = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]);
|
||||
|
||||
} else
|
||||
throw $e;
|
||||
}
|
||||
$inboundMail->documents[] = TempFile::UploadedFileFromRaw($attachment, $attachment["Name"], $attachment["ContentType"]);
|
||||
$inboundMail->documents[] = TempFile::UploadedFileFromRaw($data, $attachment["Name"], $attachment["ContentType"]);
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -137,7 +137,7 @@ class MindeeEDocument extends AbstractService
|
||||
} else {
|
||||
// The document exists as an expense
|
||||
// Handle accordingly
|
||||
nlog("Document already exists");
|
||||
nlog("Mindee: Document already exists");
|
||||
$expense->private_notes = $expense->private_notes . ctrans("texts.edocument_import_already_exists", ["date" => time()]);
|
||||
}
|
||||
$expense->save();
|
||||
|
@ -140,7 +140,7 @@ class ZugferdEDocument extends AbstractService
|
||||
} else {
|
||||
// The document exists as an expense
|
||||
// Handle accordingly
|
||||
nlog("Document already exists");
|
||||
nlog("Zugferd: Document already exists");
|
||||
$expense->private_notes = $expense->private_notes . ctrans("texts.edocument_import_already_exists", ["date" => time()]);
|
||||
}
|
||||
$expense->save();
|
||||
|
Loading…
Reference in New Issue
Block a user