瀏覽代碼

Update template

Alan Lam 3 年之前
父節點
當前提交
7d3eec7151
共有 2 個文件被更改,包括 9 次插入 和 3 次删除
  1. 6 1
      controllers/document.php
  2. 3 2
      templates/email/document.html

+ 6 - 1
controllers/document.php

@@ -432,6 +432,10 @@ $controller = new class($document_type, $document_number) {
 	public function emailPdf(): void {
 
 		$document = $this->requireDocument();
+		$core = Core::getInstance();
+
+		/** @var User $user */
+		$user = $core->getUser();
 
 		try {
 			if(!$document->contact_email) {
@@ -468,7 +472,8 @@ $controller = new class($document_type, $document_number) {
 			$search_replace = [
 				"%contact-name%" => $document->contact_name,
 				"%document-title%" => $title,
-				"%company-name%" => $company->name
+				"%company-name%" => $company->name,
+				"%user-name%" => $user->getDisplayName()
 			];
 			$body = str_replace(array_keys($search_replace), array_values($search_replace), $body);
 

+ 3 - 2
templates/email/document.html

@@ -17,10 +17,11 @@
 		Dear %contact-name%,
 	</p>
 	<p>
-		Please find attached: %document-title%
+		Thank you for your continued custom. Hereby attached is your information.
 	</p>
 	<p>
-		%company-name%
+		Regards,<br />
+		%user-name%
 	</p>
 </body>
 </html>