PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Registration mail with original URL

s2Member Plugin. A Membership plugin for WordPress®.

Registration mail with original URL

Postby shaimo » November 28th, 2011, 6:02 am

Hi,

When a user tries to access a restricted page and then fills in the registration form, it would be really great to also include in the e-mail with the password the URL of the original page he/she was trying to access so they can easily get back to the requested content. Is that possible? How?

Thanks!
User avatar
shaimo
Registered User
Registered User
 
Posts: 6
Joined: November 24, 2011

Re: Registration mail with original URL

Postby Cristián Lávaque » November 29th, 2011, 1:53 am

When the user gets redirected from the protected content to the Membership Options page, some vars are available, which include the page he was redirected from. WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variables

You could have a PHP script in your Membership Options page that stores that page in a cookie and then, after the person creates his account and logs in, have another PHP script in your login welcome page that checks if the cookie with the pre-registration page exists, and if so redirect him there.

If you don't know how to code all this, you could post a job in a freelance website like jobs.wordpress.net, oDesk.com or eLance.com.

I hope it helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Registration mail with original URL

Postby shaimo » November 30th, 2011, 9:24 am

Cristian,

Thanks a lot for the reply!!
Do you know which hook I need to use? Is it ws_plugin__s2member_after_wp_redirect_w_mop_vars? I did try to register a hook for both this one and ws_plugin__s2member_before_membership_options_page, but I'm not sure I'm getting called back and I also don't know how to extract the seeking_uri variable from there...
Any help would be greatly appreciated!!

Thanks!
User avatar
shaimo
Registered User
Registered User
 
Posts: 6
Joined: November 24, 2011

Re: Registration mail with original URL

Postby shaimo » November 30th, 2011, 4:46 pm

Hi Cristian,

I made some progress today - was able to put the right hook in place to "catch" the original url and write it into the cookie.
I'm now trying to write a hook/filter that will redirect the login to the saved url if it exists. Unfortunately I was unable to achieve this so far. I actually suspect there is some bug in the s2member code. Looking in login-redirect.inc.php I think the condition in line 69 achieves the opposite logic intended. Can it be?
In any case I thought the ws_plugin__s2member_login_redirect filter is what I need to use, but there is absolutely no documentation of how to make it work. Do you know what my function need to return and where it should put the requested redirect-to url?

Many thanks!
User avatar
shaimo
Registered User
Registered User
 
Posts: 6
Joined: November 24, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 2 guests

cron