소스 검색

Adjust test result email to remove "Congratulations!" on failed tests

Alan Lam 7 년 전
부모
커밋
95947253ce
1개의 변경된 파일과 8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      engine/test.php

+ 8 - 1
engine/test.php

@@ -258,9 +258,16 @@ class Test extends Model {
 		$pdf_path = $this->getDirectory() . "/pdf.pdf";
 		$pdf_path = $this->getDirectory() . "/pdf.pdf";
 		$pdf_name = implode(" - ", array_filter([$location->internal_id, date("jS M Y")])) . ".pdf";
 		$pdf_name = implode(" - ", array_filter([$location->internal_id, date("jS M Y")])) . ".pdf";
 
 
+		// Lead paragraph
+		$lead_paragraph = "";
+		if($this->pass) {
+			$lead_paragraph .= "Congratulations!<br />";
+		}
+		$lead_paragraph .= "A test has been completed at your location.";
+
 		// Build
 		// Build
 		$builder = new EmailBuilder;
 		$builder = new EmailBuilder;
-		$builder->addLeadParagraph("Congratulations!<br />A test has been completed at your location.");
+		$builder->addLeadParagraph($lead_paragraph);
 		$builder->addParagraph("Please see attached PDF and do not hesitate to contact us if you have any questions.");
 		$builder->addParagraph("Please see attached PDF and do not hesitate to contact us if you have any questions.");
 		$content = $builder->build();
 		$content = $builder->build();