Git Product home page Git Product logo

Comments (9)

dheerajsharma14 avatar dheerajsharma14 commented on June 16, 2024 1

I have version 2.2 and when I send the email through MailPoet, it does not send the mail with HTML. When I click on the link to preview in browser, the email generated is HTML only. The HTML is getting stripped in between.

Did this issue resolved OR I am missing something ?

from wordpress-sparkpost.

pjv avatar pjv commented on June 16, 2024

With MailPoet set up to send through "third party" using SMTP injection authentication, html emails work.

Also, WooCommerce html emails are correctly sent as html when the SparkPost plugin is configured to use the HTTP API.

from wordpress-sparkpost.

norcross avatar norcross commented on June 16, 2024

I've encountered this myself and have confirmed the API sending is stripping the HTML. Below are the three examples (native, via API, and via SMTP) doing the same "reset password" link.

native

email-native

via API

email-sparkpost-api

via SMTP

email-sparkpost-smtp

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 16, 2024

@pjv thanks for your input. Yes, if any plugin or scripts, explicitly set content type using the filter, it will work. However, we'll have to figure out why core emails are not working alike.

@norcross Thanks for confirming :). We'll prioritize and address this soon.

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 16, 2024

@norcross Actually, the problem is the opposite to what is described here. WordPress emails like forget password email, are plain/text emails. however, our plugin is setting that as html. As a result the whitespaces are ignored.

from wordpress-sparkpost.

pjv avatar pjv commented on June 16, 2024

In case this helps, I remember a similar issue coming up some time ago with the Mandrill plugin. We worked around it using some code in functions.php that leveraged a filter in the mandrill plugin and ran the message through php's nl2br function like so:

function wd_mandrill_woo_order( $message ) {
  if ( in_array( 'wp_WC_Email->send', $message['tags']['automatic'] ) ) {
      $message['html'] = $message['html'];
  } else {
      $message['html'] = nl2br( $message['html'] );
  }

  return $message;
}
add_filter( 'mandrill_payload', 'wd_mandrill_woo_order' );

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 16, 2024

@pjv thanks 👍 . I think a solution like that will solve the whitespace problem. But that still treating a text mail as html mail.

Also, at this point our plugin does not have own hooks. In future we'll add support for that. I've already solved this issue but will do little more tests. Thanks :).

from wordpress-sparkpost.

rajumsys avatar rajumsys commented on June 16, 2024

V2.0.1 released with a fix to this problem. Thanks everyone 👍

from wordpress-sparkpost.

itsdanprice avatar itsdanprice commented on June 16, 2024

I am in the same boat as @dheerajsharma14 - I am using Mailgun to send - all the emails send fine but as raw html. I am up to date with the plugin as well.

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.