Viewing 1 replies (of 1 total)
  • Anonymous User 12640152

    (@anonymized-12640152)

    Hi.

    This functionality has been added in version 1.9.1.

    From the FAQ:

    You need to declare a function that takes the content of the email as argument and then call add_filter() with the name “sendgrid_mail_text” or “sendgrid_mail_html”, depending on what part of the email you want to change.

    If you want to change the text content of all the emails before they are sent you can do it like this :

    function change_sendgrid_text_email( $message ) {
        return $message . ' changed by way of text filter ';
    }
    
    add_filter( 'sendgrid_mail_text', 'change_sendgrid_text_email' );

    If you want to change HTML content of all the emails before they are sent you can do it like this :

    function change_sendgrid_html_email( $message ) {
        return $message . ' changed by way of html filter ';
    }
    
    add_filter( 'sendgrid_mail_html', 'change_sendgrid_html_email' );

    Note that what is changed depends of the content-type that you have set in the settings page or overwritten by way of filter. For “text/plain” only the text part is overwritten by the filter. For “text/html” both the text and the HTML filters are called.

Viewing 1 replies (of 1 total)
  • The topic ‘Change from WPMandrill’ is closed to new replies.