|
|
@@ -125,6 +125,61 @@ class User extends Model {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public function sendIDPassEmail() {
|
|
|
+
|
|
|
+ // Content
|
|
|
+ $name = htmlspecialchars($this->first_name);
|
|
|
+
|
|
|
+ // Build
|
|
|
+ $builder = new EmailBuilder;
|
|
|
+ $builder->addParagraph("<b>Hi $name</b>");
|
|
|
+ $builder->addLeadParagraph("Your application has been successful!");
|
|
|
+ $builder->addParagraph("Welcome to Check Policy! Remember to check your online account for when tests become available.");
|
|
|
+ $builder->addParagraph("Keep an eye out for emails inviting you to accept a test.");
|
|
|
+ $builder->addParagraph("If you accept to do a test within the agreed period (usually 7 days) please click Accept to confirm that you would like to do the test.");
|
|
|
+ $builder->addParagraph("After you click Accept, you will be given the option to Begin the test whenever you want. Just load up your account and click Begin.");
|
|
|
+ $builder->addParagraph("Once again welcome to Check Policy - Accept, Begin, Complete and get paid for up to 8 minutes work!");
|
|
|
+ $content = $builder->build();
|
|
|
+
|
|
|
+ // Send
|
|
|
+ $mail = new Email;
|
|
|
+ $mail->setHtmlContent($content);
|
|
|
+ $mail->setFrom(EMAIL_NO_REPLY, EMAIL_FROM_NAME);
|
|
|
+ $mail->addAddress($this->email, $this->getDisplayName());
|
|
|
+ $mail->setSubject("ID accepted and verified");
|
|
|
+ $mail->send();
|
|
|
+
|
|
|
+ return true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public function sendIDFailEmail($reason = "No reason given.") {
|
|
|
+
|
|
|
+ // Content
|
|
|
+ $name = htmlspecialchars($this->first_name);
|
|
|
+ $reason = htmlspecialchars($reason);
|
|
|
+
|
|
|
+ // Build
|
|
|
+ $builder = new EmailBuilder;
|
|
|
+ $builder->addParagraph("<b>Hi $name</b>");
|
|
|
+ $builder->addLeadParagraph("Thank you for submitting your ID details.");
|
|
|
+ $builder->addParagraph("Unfortunately we could not verify and accept your documents and/or image.");
|
|
|
+ $builder->addParagraph("The reason for this is: $reason");
|
|
|
+ $builder->addParagraph("Please log in again, resubmit and we will try again.");
|
|
|
+ $builder->addParagraph("We look forward to welcoming you on-board soon!");
|
|
|
+ $content = $builder->build();
|
|
|
+
|
|
|
+ // Send
|
|
|
+ $mail = new Email;
|
|
|
+ $mail->setHtmlContent($content);
|
|
|
+ $mail->setFrom(EMAIL_NO_REPLY, EMAIL_FROM_NAME);
|
|
|
+ $mail->addAddress($this->email, $this->getDisplayName());
|
|
|
+ $mail->setSubject("We could not verify your ID details");
|
|
|
+ $mail->send();
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
public function sendPasswordResetEmail() {
|
|
|
|
|
|
$this->reset_token = bin2hex(random_bytes(16));
|