Hi again seozones,
This is mostly for those not as experienced with s2Member, or with PHP/HTML, therefore not directed at seozones himself, but those who may be interested in this for their own sites.
Here's a simple, easy way to get this working on your site.There are 2 things that need to be set up in order to get this to work, the e-mail, and the page.
In order to get the e-mail set up, you first need to enable custom e-mail settings via
Dashboard -> s2Member -> General Options -> Email ConfigurationThis is an example code that needs to be added to the e-mail.
(EDIT: in order to get this to work, follow the instructions in
viewtopic.php?f=4&t=15226 to change the form to accept HTML)
- Code: Select all
<form action="http://example.com/my-custom-page" method="post" name="regId">
<input type="hidden" name="id" value="%%user_id%%"/>
</form>
<a href="#" onClick="document.regId.submit();return false">To finish the registration process, click here.</a>
This creates a link that cannot be replicated, and only works if used through the e-mail.
Then, the action="" part of the code should be customized to the page that is being used.
The page should contain this code, which can be customized to how you like it. Really, any page could be used, as long as the conditionals block the normal output.
This is the code that will bump the user to level 1.
- Code: Select all
<?php
if (!empty($_POST['id']))
{
$user = new WP_User($_POST['id']);
$user->set_role("s2member_level1");
}
else
{
//Regular content
}
?>
And that does it. If the user got the e-mail, they should click on the link, it checks to see if the id is posted, then, if it is, it bumps the user who clicked the e-mail's account to s2Member Level 1 whether they are logged in or not.
Cheers!