1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
This commit is contained in:
paulwer 2024-08-28 09:53:38 +02:00
parent 2a28d8c976
commit 5ecb2033db
3 changed files with 6 additions and 6 deletions

View File

@ -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 {

View File

@ -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();

View File

@ -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();