Patches for inbound emails

This commit is contained in:
David Bomba 2024-09-02 13:07:01 +10:00
parent 93c382eae1
commit f117e79d43
3 changed files with 7 additions and 6 deletions

View File

@ -300,11 +300,11 @@ class PostMarkController extends BaseController
// prepare data for ingresEngine // prepare data for ingresEngine
$inboundMail = new InboundMail(); $inboundMail = new InboundMail();
$inboundMail->from = $input["From"]; $inboundMail->from = $input["From"] ?? '';
$inboundMail->to = $input["To"]; // usage of data-input, because we need a single email here $inboundMail->to = $input["To"] ; // usage of data-input, because we need a single email here
$inboundMail->subject = $input["Subject"]; $inboundMail->subject = $input["Subject"] ?? '';
$inboundMail->body = $input["HtmlBody"]; $inboundMail->body = $input["HtmlBody"] ?? '';
$inboundMail->text_body = $input["TextBody"]; $inboundMail->text_body = $input["TextBody"] ?? '';
$inboundMail->date = Carbon::createFromTimeString($input["Date"]); $inboundMail->date = Carbon::createFromTimeString($input["Date"]);
// parse documents as UploadedFile from webhook-data // parse documents as UploadedFile from webhook-data

View File

@ -57,6 +57,7 @@ class ParseEDocument extends AbstractService
try { try {
return (new ZugferdEDocument($this->file, $this->company))->run(); return (new ZugferdEDocument($this->file, $this->company))->run();
} catch (Exception $e) { } catch (Exception $e) {
nlog($this->file->get());
nlog("Zugferd Exception: " . $e->getMessage()); nlog("Zugferd Exception: " . $e->getMessage());
} }
} }

View File

@ -104,7 +104,7 @@ class ZugferdEDocument extends AbstractService
} }
$vendor = Vendor::query() $vendor = Vendor::query()
->where("company_id", $user->company()->id) ->where("company_id", $this->company->id)
->where(function ($q) use($taxid, $person_name, $contact_email){ ->where(function ($q) use($taxid, $person_name, $contact_email){
$q->when(!is_null($taxid), function ($when_query) use($taxid){ $q->when(!is_null($taxid), function ($when_query) use($taxid){
$when_query->orWhere('vat_number', $taxid); $when_query->orWhere('vat_number', $taxid);