Comments (9)
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.
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.
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.
Thanks for snippet. Can you also post body of set_email_content_type
method?
from wordpress-sparkpost.
sure.
protected function set_email_content_type( $content_type ) {
return 'text/html';
}
from wordpress-sparkpost.
Ok, I'll test with a similar implementation and see if I can reproduce the content type issue.
from wordpress-sparkpost.
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.
Same issue here. Using GravityForms and form notifications are delivered to everyone except for bcc. Following 👍
from wordpress-sparkpost.
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)
- Allow option to raise email exceptions HOT 1
- Support adding Campaign tag HOT 1
- Newly installed sparkpost plugin, getting SSL error: Failed to enable crypto HOT 3
- Show admin-wide alert if plugin is not ready to send!
- BuddyPress not sent with SparkPost HOT 3
- Why is Content-Type unsupported? HOT 9
- API Transmission Endpoint Changes HOT 2
- Retry transmissions after 5xx Error HOT 1
- Sparkpost replaces the url with a custom url HOT 3
- Emails could not be sent. htmlentities() expects parameter 1 to be string, array given in xxx HOT 8
- Missing assets folder in plugin installation HOT 6
- Retry transmissions after cURL error
- QUIT
- Sparkpost for only one contact form?
- reply-to not working
- Disable SparkPost mailer using a PHP constant
- Plugin uses incorrect bounce domain HOT 1
- Wondering if this plugin is still being maintained? HOT 1
- Deprecated notice on WP 5.5 HOT 2
- Fatal error: Uncaught Error in PHPMailer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-sparkpost.