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.

Integrate S2Member with newsletter plugin

Home Forums Community Forum Integrate S2Member with newsletter plugin

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 4 years, 5 months ago.

Topic Author Topic
Posted: Friday Jul 20th, 2012 at 4:10 am #19811

Hello,

I have 2 customers that require premium membership functionality for their website (both WP of course). The require some specific functionality that I’m not sure of if s2Member has. I’m fairly proficient at PHP so I don’t mind some coding but I would like to stay of of the s2member source code for future compatibility. But if there’s a way around something tell me please

Customer A organises workshops. If written my own registration system (outside WP) for these workshops
– Can I automatically insert users into s2member with an api that I can integrate in my own registration system?
– Can I specify groups where the customer belongs to (with this api?)

Customer B want something more complicated. He runs an electronic goods store and sell both to DIY users and professionals.

– amateur and professional users should be able to subscribe to a newsletter. Amateur users only need to specify their e-mail adres and professional users should provide more info (VAT number, companyname, etc)
– professional users should be validated by the site admin (approve membership)
– professional users will receive an e-mail with a password that they can use to login to the website (part of it)

The newsletter is more of a notification system. When the site admin creates a new posts he will categorize it as a post for amateur of prof users. Depending on this selection the users of the selected group will receive an e-mail with the posts contents.

I know s2Member is not a newsletter plugin but doe anyone has experience with integrating it with one?

Thanks for reading!

Best regards
Geert

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Saturday Jul 21st, 2012 at 7:22 am #19888

Hi Geert.

Customer A organises workshops. If written my own registration system (outside WP) for these workshops
– Can I automatically insert users into s2member with an api that I can integrate in my own registration system?
– Can I specify groups where the customer belongs to (with this api?)

The actual registration and account creation is handled by WordPress, but s2Member Pro does provide an API that makes user creation easier from another application. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Remote Operations API[/hilite]

Click to enlarge
[image_frame style="framed" width="663" height="400" align="center" alt="" title=""]http://d1v41qemfjie0l.cloudfront.net/s2member/uploads/pro-screen-remote-ops-api.jpg[/image_frame]

Here’s the example code from that documentation:
[hilite pre_code] API Scripting -> Remote Operations API`. */
/**/
$op["data"] = array (/**/
"user_login" => "johndoe22", /* Required. A unique Username. Lowercase alphanumerics/underscores. */
"user_email" => "johndoe22@example.com", /* Required. A valid/unique Email Address for the new User. */
"user_pass" => "456DkaIjsd!", /* Optional. Plain text Password. If empty, one will be generated. */
"first_name" => "John", /* Optional. First Name for the new User. */
"last_name" => "Doe", /* Optional. Last Name for the new User. */
"s2member_level" => "2", /* Optional. Defaults to Level #0 ( a Free Subscriber ). */
"s2member_ccaps" => "music,videos", /* Optional. Comma-delimited list of Custom Capabilities. */
"s2member_registration_ip" => "123.456.789.100", /* Optional. User's IP Address. If empty, s2Member will fill this upon first login. */
"s2member_subscr_gateway" => "paypal", /* Optional. User's Paid Subscr. Gateway Code. One of: (paypal|alipay|authnet|ccbill|clickbank|google). */
"s2member_subscr_id" => "I-DJASODJF8933J", /* Optional. User's Paid Subscr. ID. For PayPal®, use their Subscription ID, or Recurring Profile ID. */
"s2member_custom" => "example.com", /* Optional. If provided, should always start with your installation domain name ( i.e. $_SERVER["HTTP_HOST"] ). */
"s2member_auto_eot_time" => "2030-12-25", /* Optional. Can be any value that PHP's ``strtotime()`` function will understand ( i.e. YYYY-MM-DD ). */
"opt_in" => "1", /* Optional. A non-zero value tells s2Member to attempt to process List Servers that you've configured in the Dashboard area. */
"custom_fields" => array ("my_field_id" => "Some value."), /* Optional. An array of Custom Registration Field ID's, with associative values. */
"s2member_notes" => "Administrative notation. Created this User via API call.", /* Optional. Administrative notations. */
"notification" => "1", /* Optional. A non-zero value tells s2Member to email the new User/Member their Username/Password. */
/* The "notification" parameter also tells s2Member to notify the site Administrator about this new account. */
);
/**/
$result = trim (file_get_contents ("http://example.com/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
/**/
if (!empty ($result) && !preg_match ("/^Error\:/i", $result) && is_array ($user = @unserialize ($result)))
echo "Success. New User created with ID: " . $user["ID"];
else
echo "API error reads: " . $result;
?>
[/hilite]

Customer B want something more complicated. He runs an electronic goods store and sell both to DIY users and professionals.

– amateur and professional users should be able to subscribe to a newsletter. Amateur users only need to specify their e-mail adres and professional users should provide more info (VAT number, companyname, etc)
– professional users should be validated by the site admin (approve membership)
– professional users will receive an e-mail with a password that they can use to login to the website (part of it)

You can integrate s2Member’s levels with lists in services like MailChimp or AWeber. Video » s2Member (API List Servers)

s2Member doesn’t have an account approval process. What you could do, though, is let the professional user register to a level below where the professional content is, so he won’t be able to see it until an admin reviews his account and upgrades it manually from his profile.

I hope that helps. :)

Viewing 1 replies (of 1 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.