mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added option to enable/disable xml-attachments in the e-mail
This commit is contained in:
parent
bbd8403fe1
commit
510953630e
@ -327,12 +327,14 @@ class EmailDefaults
|
||||
}
|
||||
/** E-Invoice xml file */
|
||||
if ($this->email->email_object->settings->enable_e_invoice) {
|
||||
if ($this->email_object->settings->e_invoice_attachment ?? true){
|
||||
$xml_string = $this->email->email_object->entity->service()->getEDocument();
|
||||
|
||||
if($xml_string) {
|
||||
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($xml_string), 'name' => explode(".", $this->email->email_object->entity->getFileName('xml'))[0]."-e_invoice.xml"]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->email->email_object->settings->document_email_attachment || !$this->email->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||
return $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user