latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Html in welcome emails

Home Forums Community Forum Html in welcome emails

This topic contains 7 replies, has 6 voices. Last updated by  Aven Roy 3 years, 9 months ago.

Topic Author Topic
Posted: Saturday Apr 21st, 2012 at 12:11 pm #11511
Pero Mero
Username: gokismoki

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Sunday Apr 22nd, 2012 at 9:00 am #11551
Pero Mero
Username: gokismoki

OK, so since I din’t get any answers I was forced to dig into the code of the plugin and fix it my self.

I found that this file is used for sending the email s2member\includes\classes\email-configs.inc.php

and in line 242 just change

c_ws_plugin__s2member_email_configs::email_config () . wp_mail ($user->user_email, $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") . c_ws_plugin__s2member_email_configs::email_config_release ();

to

c_ws_plugin__s2member_email_configs::email_config () . wp_mail ($user->user_email, $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/html; charset=utf-8") . c_ws_plugin__s2member_email_configs::email_config_release ();

The trick is Content-Type: text/plain; to Content-Type: text/html;. I don’t know why it is not done by default?!?

Hope it helps some one.

Posted: Thursday May 3rd, 2012 at 2:44 am #12430

Yes this is awesome. You saved me some searching. This should definitely be default. It hurst nothing but allows us w/ fancy mail chimp templates to easily send formatted emails.

Please consider adding this!

PS I paid for this. And tweeted about it. Its the best!

Posted: Saturday May 12th, 2012 at 5:24 pm #13320
Michael
Username: leopolt001

That’s why:

wp_mail

<?php
add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
wp_mail('me@example.net', 'The subject', '<p>The <em>HTML</em> message</p>');
?>

:)

Posted: Monday Feb 4th, 2013 at 3:46 pm #40784

I tried adding this code after another snippet I got from Jason for something else to s2-hacks.php as per this post:
http://www.s2member.com/forums/topic/better-solutions-for-html-in-welcome-email/

But I get this error….
Fatal error: Class ‘c_ws_plugin__s2member_email_configs’ not found in /home/thetaste/public_html/wp-content/mu-plugins/s2-hacks.php on line 11
Am I missing something or should I directly edit the email file?

<?php
add_filter('ws_plugin__s2member_add_meta_boxes_excluded_types', 's2_meta_box_exluded_post_types');
function s2_meta_box_exluded_post_types($what_s2_says)
	{
		if(!is_super_admin())
			return array_keys (get_post_types ()); // Block in all Post Types.
			
		return $what_s2_says;
	}

c_ws_plugin__s2member_email_configs::email_config () . wp_mail ($user->user_email, $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/html; charset=utf-8") . c_ws_plugin__s2member_email_configs::email_config_release ();
Posted: Friday Mar 15th, 2013 at 11:21 pm #44879
Josh Buchanan
Username: j0sh

I couldn’t figure out the hack either, I edited the source file which will be over written with an update…

An option for this would be great!

If anyone came up with the mu-plugin can you please post?

Thanks!

Posted: Saturday Mar 16th, 2013 at 2:04 am #44899

Sorry, as you can see no one ever responded to me…i had to hack the file and remember to refix after upgrading.

Posted: Saturday Apr 6th, 2013 at 7:31 am #46736
Aven Roy
Username: aven

I’ve been searching for this option in s2members plugin. Is still unavailable adn i have to change manually the code as said before Pero Moreno. Is there another way to send welcome mails in html format?

I’ve been searching more information about this topic with no results. Any help would be very apreciated :)

Thanks in advance

Wp v. 3.5.1
s2members v. 130404
Site: http://www.tierraquebrada.com

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.