mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-02 22:57:33 -05:00 
			
		
		
		
	wip
This commit is contained in:
		
							parent
							
								
									875c7ba950
								
							
						
					
					
						commit
						417260e25d
					
				@ -59,12 +59,12 @@ class TemplateEmail extends Mailable
 | 
				
			|||||||
            DesignHelpers::parseMarkdownToHtml($this->build_email->getBody())
 | 
					            DesignHelpers::parseMarkdownToHtml($this->build_email->getBody())
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->build_email->setBody(
 | 
					 | 
				
			||||||
            TemplateEngine::wrapElementsIntoTables('<div id="content-wrapper"></div>', $this->build_email->getBody())
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $settings = $this->client->getMergedSettings();
 | 
					        $settings = $this->client->getMergedSettings();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $this->build_email->setBody(
 | 
				
			||||||
 | 
					            TemplateEngine::wrapElementsIntoTables('<div id="content-wrapper"></div>', $this->build_email->getBody(), $settings)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $company = $this->client->company;
 | 
					        $company = $this->client->company;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if($this->invitation)
 | 
					        if($this->invitation)
 | 
				
			||||||
 | 
				
			|||||||
@ -200,7 +200,7 @@ class TemplateEngine
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $data = [
 | 
					        $data = [
 | 
				
			||||||
            'subject' => $this->subject,
 | 
					            'subject' => $this->subject,
 | 
				
			||||||
            'body' => self::wrapElementsIntoTables(strtr($wrapper, ['$body' => '']), $this->body),
 | 
					            'body' => self::wrapElementsIntoTables(strtr($wrapper, ['$body' => '']), $this->body, $this->entity_obj->client->getMergedSettings()),
 | 
				
			||||||
            'wrapper' => $wrapper,
 | 
					            'wrapper' => $wrapper,
 | 
				
			||||||
            'raw_body' => $this->raw_body,
 | 
					            'raw_body' => $this->raw_body,
 | 
				
			||||||
            'raw_subject' => $this->raw_subject
 | 
					            'raw_subject' => $this->raw_subject
 | 
				
			||||||
@ -254,7 +254,7 @@ class TemplateEngine
 | 
				
			|||||||
        DB::rollBack();
 | 
					        DB::rollBack();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static function wrapElementsIntoTables(string $wrapper, string $body): ?string
 | 
					    public static function wrapElementsIntoTables(string $wrapper, string $body, $settings): ?string
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $documents['wrapper'] = new \DOMDocument();
 | 
					        $documents['wrapper'] = new \DOMDocument();
 | 
				
			||||||
        $documents['wrapper']->loadHTML($wrapper);
 | 
					        $documents['wrapper']->loadHTML($wrapper);
 | 
				
			||||||
@ -262,7 +262,7 @@ class TemplateEngine
 | 
				
			|||||||
        $documents['master'] = new \DOMDocument();
 | 
					        $documents['master'] = new \DOMDocument();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $documents['master']->loadHTML(
 | 
					        $documents['master']->loadHTML(
 | 
				
			||||||
          view('email.template.master', ['header' => '', 'slot' => ''])->render()
 | 
					          view('email.template.master', ['header' => '', 'slot' => '', 'settings' => $settings])->render()
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $styles = $documents['master']->getElementsByTagName('style')->item(0)->nodeValue;
 | 
					        $styles = $documents['master']->getElementsByTagName('style')->item(0)->nodeValue;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user