Page 1 of 1

Need membership level in admins new user notification email

PostPosted: December 27th, 2011, 4:37 pm
by Uncle Geo
I want the new user notification for admins to include our custom form data (I figured that part out) and the member's sign-up level (I haven't figured that part out).

Is there a way to add their membership level to that e-mail?

Re: Need membership level in admins new user notification em

PostPosted: December 27th, 2011, 4:49 pm
by Raam Dev
Hi Uncle Geo,

Can you share the code you're using to include the custom form data?

Re: Need membership level in admins new user notification em

PostPosted: December 28th, 2011, 3:17 pm
by Uncle Geo
Raam,

I'm just adding in the field names as instructed in the Admniistrator: New User Notification area under E-mail Config. The first four are default fields already in there and the rest I added from the field names on the custom form -to whit:

Code: Select all
New User Registration on your site:
Small Business MN

User ID: %%user_id%%
Username: %%user_login%%
Email: %%user_email%%
IP Address: %%user_ip%%
company_name: %%company_name%%
position: %%position%%
street_address: %%street_address%%
address2: %%address2%%
city: %%city%%
state: %%state%%
zip: %%zip%%
phone: %%phone%%
company_email: %%company_email%%
company_website: %%company_website%%
employees: %%employees%%
company_does: %%company_does%%
home_address: %%home_address%%
home_city: %%home_city%%
home_state: %%home_state%%
home_zip: %%home_zip%%
home_tel: %%home_tel%%
cel: %%cel%%
home_email: %%home_email%%
spouse_name: %%spouse_name%%
pref_email: %%pref_email%%
pref_phone: %%pref_phone%%
mail: %%mail%%
pref_listing: %%pref_listing%%
pref_vol: %%pref_vol%%


I guessed (wrongly) that %% member_level%% might return the member level in the new user e-mail sent to admins.

Re: Need membership level in admins new user notification em

PostPosted: December 29th, 2011, 5:13 am
by Cristián Lávaque
Yeah, I don't see a replacement code for his level. You could try using the Custom Replacement Codes, though, adding to the custom field the level the user is purchasing. WP Admin -> s2Member -> General Options -> Email -> New User -> Administrator -> Custom Replacement Codes

I hope that helps. :)

Re: Need membership level in admins new user notification em

PostPosted: December 29th, 2011, 3:55 pm
by Uncle Geo
Thanks! I think I see where you are going -check this and let me know if I'm way off or not:

In the E-mail Configuration/New User notification Message I see the "custom replacement codes" you mentioned which suggests I add a custom value into the shortcode. I might choose cv1 and set it to value "75" like this:
Code: Select all
Member: $75/year [s2Member-Pro-Google-Button level="2" ccaps="" desc="Member" cc="USD" custom="www.smallbusinessmn.org" cv1="75" ta="75.00" tp="1" tt="Y" ra="75.00" rp="1" rt="Y" rr="1" image="default" output="anchor" /]


This suggests that Google will return that cv1 value as 75 to S2Member's database at my Worpress install when it is done extracting cash from my new member.

It seems I would then add %%cv1%% to the list if fields in the New User Notification Message.

Any of that sound right? (I'm checking first because payments are working now I don't want to break that!)

Re: Need membership level in admins new user notification em

PostPosted: December 29th, 2011, 4:06 pm
by Uncle Geo
Thinking more on this, because I have more than one member level I'd need to include a custom value for all existing member levels. Is this what is meant by pipelining?:

custom="www.smallbusinessmn.org|cv1|cv2|cv3"

Do I then put all these %%cv1%% %%cv2%% %%cv3%% in the New User Email Notification Message area? And then only one will have a value when the e-mail is sent?

Am I off the rails, in over my head and hopelessly lost at this point?

Re: Need membership level in admins new user notification em

PostPosted: December 30th, 2011, 12:23 am
by Cristián Lávaque
You're almost there.

Yes, you'd pipe the custom value like this: custom="www.smallbusinessmn.org|1" where the 1 would be the Level of the user.

You can change that dynamically, too. viewtopic.php?f=36&t=1604
WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants

Code: Select all
custom="www.smallbusinessmn.org|<?php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; ?>"



Then in the email you'd use it like this: User Level %%cv1%%.

I hope that helps. :)

Re: Need membership level in admins new user notification em

PostPosted: December 30th, 2011, 3:58 pm
by Uncle Geo
Thanks, That's making sense but I want to be sure before I do it. Does this sequence look right?

I install and activate the PHP Execution plugin.

I add the php line you gave me into the shortcode for each signup level button like this (I'm showing only two of the levels but I changed them all to include the php line):
Code: Select all
Member: $75/year [s2Member-Pro-Google-Button level="2" ccaps="" desc="Member" cc="USD" custom="www.smallbusinessmn.org|<?php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; ?>" ta="75.00" tp="1" tt="Y" ra="75.00" rp="1" rt="Y" rr="1" image="default" output="anchor" /]

Supporter: 150/year [s2Member-Pro-Google-Button level="3" ccaps="" desc="Supporter" cc="USD" custom="www.smallbusinessmn.org|<?php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; ?>" ta="150.00" tp="1" tt="Y" ra="150.00" rp="1" rt="Y" rr="1" image="default" output="anchor" /]


Then I'd add user_level %%cv1%% into the Administrative: User Notification Email.

Logically is it going like this?:

The PHP line is what picks up the user level from level="n" within the button's shortcode and stores it in an array or table (or sends it along to Google with the other info and Google sends it back).

Then that value is retrieved and added to the e-mail by the line user_level %%cv1%% in the Administrative: User Notification E-mail. And it knows it's cv1 because it's the first and only custom value in the shortcode.

(By now you see I'm not a programmer!)

Re: Need membership level in admins new user notification em

PostPosted: December 31st, 2011, 6:06 am
by Cristián Lávaque
You may not be a programmer, but you got it right. :)

By the way, you can have more than one custom value custom="www.yoursite.com|firstvalue|secondvaule|etc" and they'd be available as %%cv1%%, %%cv2%% and %%cv3%%. The domain name is not counted as a cv#, only those after it.

Re: Need membership level in admins new user notification em

PostPosted: January 2nd, 2012, 3:20 pm
by Uncle Geo
Cristian,

Then there may be hope for me yet!

Thank you for your timely, persistent and, pardon the pun, primo support!

Geo

Re: Need membership level in admins new user notification em

PostPosted: January 3rd, 2012, 11:48 pm
by Cristián Lávaque
You're welcome! Glad I could help you. :)