Email sending event - How to debug?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
iggabz
User
Posts: 110

Email sending event - How to debug?

Post 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;
}

arbei
User
Posts: 9719

Post 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.

iggabz
User
Posts: 110

Post by iggabz »

thank you for this.


Post Reply