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.

Signup Confirmation Email 4 different levels

Home Forums Community Forum Signup Confirmation Email 4 different levels

This topic contains 7 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 18th, 2012 at 12:36 pm #28855
Juan Vanegas
Username: juanjo

Hi, im trying to setup two sets of Signup confirmation emails, one for paying custumers wich are in level 2 and for free customers wich will be at level 1 ( using pro-forms free subscription ), so is there any way two setup different emails depending on the subscription level ?

Thks a lot guys

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Thursday Oct 18th, 2012 at 6:35 pm #28934
Raam Dev
Username: Raam
Staff Member

Hi Jaun,

This will require overriding the default signup email and then building and sending your own emails using PHP. This thread should provide a view pointers on where to start.

Posted: Friday Oct 19th, 2012 at 10:20 am #29019
Juan Vanegas
Username: juanjo

Thaks, im was trying to go through the trhead the you mentioned, and as you said with this piece of code

<?php
add_filter ("ws_plugin__s2member_signup_email_sbj", "my_s2_signup_sbj", 10, 2);
function my_s2_signup_sbj ($s2member_default_sbj, $vars = array ())
    {
        return "Congratulations ( your account has been approved )";
    }
add_filter ("ws_plugin__s2member_signup_email_msg", "my_s2_signup_msg", 10, 2);
function my_s2_signup_msg ($s2member_default_msg, $vars = array ())
    {
        return "Thank you! You purchased:\n"  
        add_query_arg("action", "register", wp_login_url ());
    }
?>

placed at mysite/wp-content/mu-plugins, file name s2-hacks.php
should be able to overwrite the default New User Email Message and after several test no such luck, it still sending the defualt New User Email Message, not quite sure what i’m doing wrong, if i’m missing any piece of code, if its not the right location, btw im runing wordpress 3.4 and s2member Pro Version: 120703 dont know if that makes any kind of difference.

I did tryed adding

file_put_contents(WP_CONTENT_DIR."/debug.log", var_export($vars, true));

in the code

add_filter ("ws_plugin__s2member_signup_email_sbj", "my_s2_signup_sbj", 10, 2);
function my_s2_signup_sbj ($s2member_default_sbj, $vars = array ()){
   	print_r($vars);
    file_put_contents(WP_CONTENT_DIR."/debug.log", var_export($vars, true));
       return "Congratulations 2  ( your account has been approved )";

   }

so i ca get the log file to get the vars inside the array becouse im not quite sure where to see the print_r($vars) in the browser, but the log its not been created at all

so im not sure what im doing wrong here, and where to go from here, hopefully you can help me out with this i really appreciate

Posted: Saturday Oct 20th, 2012 at 12:30 am #29097
Raam Dev
Username: Raam
Staff Member

If you don’t see the log file get created, that would indicate that the filter on ws_plugin__s2member_signup_email_sbj is not being triggered, so your function is never running.

Are you receiving any signup confirmation email when you do a test Free Registration?

Posted: Saturday Oct 20th, 2012 at 1:45 am #29112
Juan Vanegas
Username: juanjo

Yes i do get the Default confirmation email

Hi USER,
Thank you for purchasing . 

Here is your Username and Password:
Username: xxx
Password: xxx

Once logged in, you can change your password anytime on your own.

You can login to your account at http://www.xxxxx.com

Enjoy!
  • This reply was modified 4 years, 2 months ago by  Juan Vanegas.
Posted: Monday Oct 22nd, 2012 at 1:25 pm #29282
Raam Dev
Username: Raam
Staff Member

That is the ‘New User Email Message’, not the ‘Signup Confirmation Email’.

The filters you probably want are ws_plugin__s2member_registration_notification_email_sbj (docs here) and ws_plugin__s2member_registration_notification_email_msg (docs here).

Posted: Monday Oct 22nd, 2012 at 3:04 pm #29323
Juan Vanegas
Username: juanjo

thks Raam once again for the help, i did the changes my code to add the correct filters, just to be clear, with
ws_plugin__s2member_registration_notification_email_sbj and ws_plugin__s2member_registration_notification_email_msg i would be able to change the default New User Email Message thereby i can add conditional for sending emial depending of the user membership LEVEL ,
Current message:

Hi USER,
Thank you for purchasing . 

Here is your Username and Password:
Username: xxx
Password: xxx

Once logged in, you can change your password anytime on your own.

You can login to your account at http://www.xxxxx.com

Enjoy

I ended up with the fallowing code in my s2-hacks.php file

add_filter ("ws_plugin__s2member_registration_notification_email_sbj", "my_s2_signup_sbj", 10, 2);
function my_s2_signup_sbj ($s2member_default_sbj, $vars = array ()){
	print_r($vars);
 file_put_contents(WP_CONTENT_DIR."/debug.log", var_export($vars, true));
    return "Congratulations 2  ( your account has been approved )";

}

	// add_filter ("ws_plugin__s2member_signup_email_msg", "my_s2_signup_msg", 10, 2);
add_filter ("ws_plugin__s2member_registration_notification_email_msg", "my_s2_signup_msg", 10, 2);
function my_s2_signup_msg ($s2member_default_msg, $vars = array ()){
	print_r($vars);

    return "Thank you! 2 You purchased:";
   }

still not working, i did several test and no luck yet i was trying to get more info about the $s2member_default_msg and $s2member_default_sbj not quite sure if these are the parameters the are giving me the problem, perhaps can point me in the right direction, thanks for the help

Posted: Tuesday Oct 23rd, 2012 at 7:23 pm #29465

Juan, I searched the source files for a while looking for a filter for the New User email until I found the file where the code is. s2member\includes\classes\email-configs.inc.php

Didn’t find filters, but found them in the s2Member options array, so you can try editing that.

[hilite code]$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"][/hilite]
[hilite code]$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"][/hilite]

I hope that helps. :)

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.