Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tanaylakhani

    (@tanaylakhani)

    @casiepa

    Do you have the working patch with wp_mail?

    Thread Starter Pascal Casier

    (@casiepa)

    What I just do is this:

    I have edited /wp-content/plugins/simple-subscribe/libs/SimpleSubscribe/Email.php and changed the sendEmail function to the below.

    Of course you will have to apply this also to the other functions that send mail.

    Pascal.

    private function sendEmail($recipients = array(), $subject = '', $data)
        {
            // recipients check
            if(!is_array($recipients)){ $recipients = array($recipients); }
            if(count($recipients) < 1){
                throw new EmailException('No subscribers provided. (possibly none in your system)');
            }
            // try sending e-mail
            try{
    
                // set HTML / or plaintext body
                if($this->htmlEmail == TRUE){
                    $headers = array('Content-Type: text/html; charset=UTF-8');
                } else {
                    $headers = array('Content-Type: text/plain; charset=UTF-8');
                }
    
                // Send the mail
                wp_mail( $recipients, $subject, $this->getEmailTemplate($data), $headers);
            } catch(\Exception $e){
                throw new EmailException($e->getMessage());
            }
        }
    Thread Starter Pascal Casier

    (@casiepa)

    Something also changed with HTML characters, so I had to add 2 lines before the ‘// try sending e-mail’

    // convert HTML tags
            $data["message"] = htmlspecialchars_decode($data["message"]);
            // try sending e-mail
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Simple-Subscribe 2.0: Subscribers list OK, but not using wp_mail’ is closed to new replies.