mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Handle inline attachments in custom designs
This commit is contained in:
parent
1f6621e3f8
commit
7535931493
@ -51,8 +51,35 @@ class TemplateEmail extends Mailable
|
|||||||
$this->invitation = $invitation;
|
$this->invitation = $invitation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supports inline attachments for large
|
||||||
|
* attachments in custom designs
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function buildLinksForCustomDesign(): string
|
||||||
|
{
|
||||||
|
$links = $this->build_email->getAttachmentLinks();
|
||||||
|
|
||||||
|
if(count($links) == 0)
|
||||||
|
return '';
|
||||||
|
|
||||||
|
$link_string = '<ul>';
|
||||||
|
|
||||||
|
foreach($this->build_email->getAttachmentLinks() as $link)
|
||||||
|
{
|
||||||
|
$link_string .= "<li>{$link}</li>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$link_string .= '</ul>';
|
||||||
|
|
||||||
|
return $link_string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
|
|
||||||
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
||||||
|
|
||||||
if ($this->build_email->getTemplate() == 'light' || $this->build_email->getTemplate() == 'dark') {
|
if ($this->build_email->getTemplate() == 'light' || $this->build_email->getTemplate() == 'dark') {
|
||||||
@ -60,7 +87,7 @@ class TemplateEmail extends Mailable
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->build_email->getTemplate() == 'custom') {
|
if ($this->build_email->getTemplate() == 'custom') {
|
||||||
$this->build_email->setBody(str_replace('$body', $this->build_email->getBody(), $this->client->getSetting('email_style_custom')));
|
$this->build_email->setBody(str_replace('$body', $this->build_email->getBody().$this->buildLinksForCustomDesign(), $this->client->getSetting('email_style_custom')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$settings = $this->client->getMergedSettings();
|
$settings = $this->client->getMergedSettings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user