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