• Resolved DDT

    (@ddt)


    In a wpcf7_before_send_mail function i add a custom html body like so

    $mail2['body'] .= get_email_styled_en();

    function get_email_styled_en(){
        ob_start();
        require_once 'email_style_ticket_en.php';
        $returner = ob_get_clean();
        return $returner;
    }

    this works, but i also need a plain/text part, how can i do this???

    When i just add text in contact form 7 body 2 textfield, the plain text displays above my html content

    regards,

    https://wordpress.org/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • Thread Starter DDT

    (@ddt)

    Found a workable:

    add_action('phpmailer_init','update_priority_mailer');
    function update_priority_mailer($mailer){
    
        $plain_text = "
            plain text \n
    ";
    
        $mailer->AltBody = $plain_text;   
    
    }

Viewing 1 replies (of 1 total)
  • The topic ‘How to set a multipart body in wpcf7 before_send_mail??’ is closed to new replies.