Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-09T18:53:23-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14623 2011-09-09T18:53:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=34425#p34425 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]> Hi there. Thanks for the follow-up.

Sorry, I just ran a test against your bug report, but I was unable to reproduce this. Can you please post a copy of and/or an excerpt from your PHP script? We'll take a look and see if we can help you out. I can confirm that <?php echo get_user_option("s2member_subscr_id", %%user_id%%); ?> does work inside a custom PHP script tied to s2Member's Registration Notification.

Please note, that is just a code sample using pseudo code. In a real-world example, your custom script would assign the value of %%user_id%% to a query string parameter passed in to your script. So you might have somthing like this configured in your s2Member API Notification for Registrations.
Code:
http://example.com/my-script.php?user_id=%%user_id%%
Inside your script, you would do this:
Code:
<?php echo get_user_option("s2member_subscr_id", $_GET["user_id"]); ?>

Statistics: Posted by Jason Caldwell — September 9th, 2011, 6:53 pm


]]>
2011-09-07T15:40:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=34244#p34244 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]>
The data available/returned by the signup and registration events do not share a common key (see the list elsewhere in this thread), so there is no way to relate the two dataset if they are to be captured as a result of the notifications.

I'd implemented a script to call get_user_option("s2member_subscr_id", %%user_id%%), fired at the time of a registration notification event (URL) for a valid subscription. Unfortunately this seems to always return NULL at the time the notification is fired.

As a result, I've had to reluctantly implement a change it core s2M code, specifically adding the following line to the configure_user_registration function in registrations.inc.php just prior to c_ws_plugin__s2member_utils_urls::remote ($url)...

Code:
$url = preg_replace ("/%%subscr_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($subscr_id)), $url);


...and of course pass the %%subscr_id%% substitution string on the notification URL.

This works fine. Am I missing something or is there no other way around changing s2M code? Shouldn't this be included in a future release of s2M (understanding it will return NULL when not ?

T

Statistics: Posted by tkittredge — September 7th, 2011, 3:40 pm


]]>
2011-08-25T00:48:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32827#p32827 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]>

Statistics: Posted by Cristián Lávaque — August 25th, 2011, 12:48 am


]]>
2011-08-24T06:53:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32780#p32780 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]> Todd

Statistics: Posted by tkittredge — August 24th, 2011, 6:53 am


]]>
2011-08-23T19:13:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32714#p32714 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]> Thanks for the heads up on this thread Cristián.
~ and thanks for the great question.

tkittredge wrote:
The name and email values return between signup and registration events are not necessarily the same.

Since in my scenario I am calling script to record the information from the two independent events as they naturally occur (subscription and registration events), we need a way to key the two datasets together.

Would <?php $subscr_id = get_user_option("s2member_subscr_id", %%user_id%%); ?> invoked as a result of the registration event be guaranteed to be the key against the %%subscr_id%% value returned with the signup event?

Shouldn’t %%subscr_id%% also be returned with the registration event by s2M?
T
Yea, I'll see what we can do about that. Not all "Registrations" are associated with a Paid Subscr. ID. However if/when they are, you can certainly use: get_user_option("s2member_subscr_id", %%user_id%%); as passed through by the Registration API Notification. If the value returned is non-zero, they ARE a paying Member, if it's empty, they're just registering for free ( i.e. Open Registration is enabled on the site ). When this value is non-zero, it WILL exactly match the value returned in the Signup Notification, so yes.

Statistics: Posted by Jason Caldwell — August 23rd, 2011, 7:13 pm


]]>
2011-08-23T09:32:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32687#p32687 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]>
Since in my scenario I am calling script to record the information from the two independent events as they naturally occur (subscription and registration events), we need a way to key the two datasets together.

Would <?php $subscr_id = get_user_option("s2member_subscr_id", %%user_id%%); ?> invoked as a result of the registration event be guaranteed to be the key against the %%subscr_id%% value returned with the signup event?

Shouldn’t %%subscr_id%% also be returned with the registration event by s2M?
T

Statistics: Posted by tkittredge — August 23rd, 2011, 9:32 am


]]>
2011-08-22T22:31:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32651#p32651 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]> Statistics: Posted by Cristián Lávaque — August 22nd, 2011, 10:31 pm


]]>
2011-08-21T19:29:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32591#p32591 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]>
Is there a way to link the data collected at the time of signup with the data returned at time of registration? None of the data returned by the two events links one to the other...

Signup...

%%subscr_id%%
%%initial%%
%%regular%%
%%recurring%%
%%first_name%%
%%last_name%%
%%full_name%%
%%payer_email%%
%%item_number%%
%%item_name%%
%%initial_term%%
%%regular_term%%

Registration...

%%role%%
%%level%%
%%ccaps%%
%%auto_eot_time%%
%%user_first_name%%
%%user_last_name%%
%%user_full_name%%
%%user_email%%
%%user_login%%
%%user_pass%%
%%user_id%%

Would <?php $subscr_id = get_user_option("s2member_subscr_id", %%user_id%%); ?> during a registration event be guaranteed to be the key against the %%subscr_id%% value returned at time of signup?

Shouldn’t %%subscr_id%% also be returned with the registration event by s2M?
T

Statistics: Posted by tkittredge — August 21st, 2011, 7:29 pm


]]>
2011-08-19T22:39:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32430#p32430 <![CDATA[Re: Signup/Registration Notification Key %%subscr_id%% ?]]> http://www.s2member.com/api-tracking-no ... ons-video/ I seem to remember Jason explaining what the replacement codes there.

Let me know if it helps.

Statistics: Posted by Cristián Lávaque — August 19th, 2011, 10:39 pm


]]>
2011-08-19T20:05:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14623&p=32411#p32411 <![CDATA[Signup/Registration Notification Key %%subscr_id%% ?]]>
If I fire a script (URL) and capture data as a result of a signup notification and then another as a result of the registration notification, since the two are independent of one another (if/when the user chooses to complete registration) how can I link the two data sets? Does <?php $subscr_id = get_user_option("s2member_subscr_id", %%user_id%%); ?> fired as a result and at the time of a registration event return the $subscr_id guaranteed to be the key against the %%subscr_id%% value returned at time of signup?

Shouldn’t %%subscr_id%% also be returned with the registration event by s2M?

T

Statistics: Posted by tkittredge — August 19th, 2011, 8:05 pm


]]>