minor logging improvements

This commit is contained in:
paulwer 2024-03-24 12:51:24 +01:00
parent 8031f1c277
commit 2cbeb23d8f
2 changed files with 7 additions and 7 deletions

View File

@ -124,13 +124,13 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
// match company
$company = MultiDB::findAndSetDbByExpenseMailbox($recipient);
if (!$company) {
Log::info('unknown Expense Mailbox occured while handling an inbound email from brevo: ' . $recipient);
Log::info('[ProcessBrevoInboundWebhook] unknown Expense Mailbox occured while handling an inbound email from brevo: ' . $recipient);
continue;
}
$company_brevo_secret = $company->settings?->email_sending_method === 'client_brevo' && $company->settings?->brevo_secret ? $company->settings?->brevo_secret : null;
if (empty ($company_brevo_secret) && empty (config('services.brevo.secret')))
throw new \Error("no brevo credenitals found, we cannot get the attachement");
throw new \Error("[ProcessBrevoInboundWebhook] no brevo credenitals found, we cannot get the attachement");
// prepare data for ingresEngine
$ingresEmail = new IngresEmail();
@ -156,7 +156,7 @@ class ProcessBrevoInboundWebhook implements ShouldQueue
} catch (\Error $e) {
if (config('services.brevo.secret')) {
Log::info("Error while downloading with company credentials, we try to use defaul credentials now...");
Log::info("[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"]);

View File

@ -168,7 +168,7 @@ class ProcessMailgunInboundWebhook implements ShouldQueue
// match company
$company = MultiDB::findAndSetDbByExpenseMailbox($recipient);
if (!$company) {
Log::info('unknown Expense Mailbox occured while handling an inbound email from mailgun: ' . $recipient);
Log::info('[ProcessMailgunInboundWebhook] unknown Expense Mailbox occured while handling an inbound email from mailgun: ' . $recipient);
return;
}
@ -176,7 +176,7 @@ class ProcessMailgunInboundWebhook implements ShouldQueue
$company_mailgun_domain = $company->settings?->email_sending_method === 'client_mailgun' && $company->settings?->mailgun_domain ? $company->settings?->mailgun_domain : null;
$company_mailgun_secret = $company->settings?->email_sending_method === 'client_mailgun' && $company->settings?->mailgun_secret ? $company->settings?->mailgun_secret : null;
if (!($company_mailgun_domain && $company_mailgun_secret) && !(config('services.mailgun.domain') && config('services.mailgun.secret')))
throw new \Error("no mailgun credenitals found, we cannot get the attachements and files");
throw new \Error("[ProcessMailgunInboundWebhook] no mailgun credenitals found, we cannot get the attachements and files");
$mail = null;
if ($company_mailgun_domain && $company_mailgun_secret) {
@ -190,7 +190,7 @@ class ProcessMailgunInboundWebhook implements ShouldQueue
$mail = json_decode(file_get_contents($messageUrl));
} catch (\Error $e) {
if (config('services.mailgun.secret')) {
Log::info("Error while downloading with company credentials, we try to use defaul credentials now...");
Log::info("[ProcessMailgunInboundWebhook] Error while downloading with company credentials, we try to use default credentials now...");
$credentials = config('services.mailgun.domain') . ":" . config('services.mailgun.secret') . "@";
$messageUrl = explode("|", $this->input)[1];
@ -238,7 +238,7 @@ class ProcessMailgunInboundWebhook implements ShouldQueue
} catch (\Error $e) {
if (config('services.mailgun.secret')) {
Log::info("Error while downloading with company credentials, we try to use defaul credentials now...");
Log::info("[ProcessMailgunInboundWebhook] Error while downloading with company credentials, we try to use default credentials now...");
$credentials = config('services.mailgun.domain') . ":" . config('services.mailgun.secret') . "@";
$url = $attachment->url;