Git Product home page Git Product logo

Comments (9)

farlandlee avatar farlandlee commented on June 19, 2024

Looks like this is a duplicate of #23. However when I switched to SMTP it sent my html email as text despite my switching the content type to html.

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 19, 2024

However when I switched to SMTP it sent my html email as text despite my switching the content type to html.

What emails you're referring to? Are these generic wordpress emails (like signup, forgot password) or your custom emails. IIRC, content type is text by default. If you want to send html email you need to use content type filter. If you set that filter, your mails through SparkPost should also be sent in HTML format.

from wordpress-sparkpost.

farlandlee avatar farlandlee commented on June 19, 2024

Sorry I should have provided a code snippet. I am sending custom emails. This is being sent from within a class I built to generate and send transactional emails.

$headers = 'From: '. $this->_from . "\r\n";
if($this->_rental_options['api_mode'] === 'production' && $test != true) $headers .= "Bcc: [email protected]\r\n";

            if(is_array($this->_email_details['attachments'])) {
                foreach($this->_email_details['attachments'] as $attachment) {
                    $this->setAttachments($attachment);
                }
            }

            add_filter( 'wp_mail_content_type', array($this,'set_email_content_type') );

            $subject = html_entity_decode ( $this->parse_email_shortcodes($this->_email_details['email_subject']), ENT_QUOTES, 'UTF-8' );

            $return = wp_mail( $to, $subject, $this->build_email(), $headers, $this->_attachments);

            remove_filter( 'wp_mail_content_type', array($this,'set_email_content_type') );

            return $return;

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 19, 2024

Thanks for snippet. Can you also post body of set_email_content_type method?

from wordpress-sparkpost.

farlandlee avatar farlandlee commented on June 19, 2024

sure.

protected function set_email_content_type( $content_type ) {
    return 'text/html';
}

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 19, 2024

Ok, I'll test with a similar implementation and see if I can reproduce the content type issue.

from wordpress-sparkpost.

farlandlee avatar farlandlee commented on June 19, 2024

Thanks!

On Thu, Apr 21, 2016 at 11:40 AM, rajumsys [email protected] wrote:

Ok, I'll test with a similar implementation and see if I can reproduce the
content type issue.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#34 (comment)

Matthew Lee
FARLAND LEE STUDIOS
307.690.5399

from wordpress-sparkpost.

thethomasgroup avatar thethomasgroup commented on June 19, 2024

Same issue here. Using GravityForms and form notifications are delivered to everyone except for bcc. Following 👍

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 19, 2024

We haven't heard similar issue for long. It should be working fine now. Please re-open if issue persists.

from wordpress-sparkpost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.