Page 1 of 1

Email sending event - How to debug?

Posted: Fri Jul 12, 2024 3:24 pm
by iggabz

Good day,

i tried this but default email was sent. any way to make this work?

function Email_Sending($email, $args) {
    $recipients = array($args["rsnew"]["email"], "fox@gmail.com");
    
    if ($this->action->CurrentValue == "For Action") {
        $email->Subject = "URGENT:FOR ACTION WITH TRACKING NO. " . $this->doc_id->CurrentValue;
        $emailContent .= "<br><br> Relative to this, may we request that you look into the matter and provide the necessary action(s) mindful of the Twelve (12) hours given to respond.";
    } elseif ($this->action->CurrentValue == "For Resolution") {
        $email->Subject = "TRANSACTION FOR RESOLUTION WITH TRACKING NO. " . $this->doc_id->CurrentValue;
        $emailContent .= "<br><br> Kindly ensure that the client has been provided with feedback regarding the resolution of their concern before marking the grievance case as resolved.";
    } elseif ($this->action->CurrentValue == "For Amendment") {
        $email->Subject = "FOWARDED TRANSACTION NEEDS AMENDMENT WITH TRACKING NO. " . $this->doc_id->CurrentValue;
        $emailContent .= "<br><br> Please ensure that you have addressed the request as indicated in the remarks column before forwarding the grievance case to the appropriate staff for further action.";
    }
    
    // Common closing for all scenarios
    $emailContent .= "<br><br><br> Best Regards,";
    $emailContent .= "<br> ADMIN";
    
    $email->Recipient = implode(", ", $recipients);
    $email->Content = $emailContent;
    
    // Assuming email sending is successful
    return true;
}

Re: Email sending event

Posted: Fri Jul 12, 2024 4:36 pm
by arbei

You may

  1. Turn on Debug and check the SMTP log (by PHPMailer) in the log file.
  2. Use var_dump($email) to check the properties after your customization.

Re: Email sending event

Posted: Tue Jul 16, 2024 10:31 am
by iggabz

thank you for this.