Kaynağa Gözat

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

Alan Lam 7 yıl önce
ebeveyn
işleme
95947253ce
1 değiştirilmiş dosya ile 8 ekleme ve 1 silme
  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_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
 		$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.");
 		$content = $builder->build();