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.

Dashboard -› s2Member® -› API / Notifications

Home Forums Community Forum Dashboard -› s2Member® -› API / Notifications

This topic contains 5 replies, has 2 voices. Last updated by  Raam Dev 4 years, 3 months ago.

Topic Author Topic
Posted: Monday Sep 24th, 2012 at 1:51 pm #26337

Is there a tutorial for API/Notifications? All I want to do is ensure that 2 email addresses are notified every time a payment is received or a role automatically changes (admin and superuser edits should not trigger an email). Do I have to write a webpage to receive the information and then send it to the appropriate email addresses?

I’m using Version 120703 + s2Member Pro v120703.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Sep 25th, 2012 at 1:17 am #26392
Raam Dev
Username: Raam
Staff Member

At the bottom of each of the Notification panels in Dashboard -› s2Member® -› API / Notifications, there’s a box where you can enter an email address (or several email addresses separated by commas) to be notified when specific changes occur.

The two you’re probably interested in are:

Dashboard -› s2Member® -› API / Notifications -› Payment Notifications
Dashboard -› s2Member® -› API / Notifications -› Modification Notifications

Posted: Tuesday Sep 25th, 2012 at 9:53 am #26433

Ok, so I can receive a data dump at the emails of my choice. Is there a tutorial for sending out a formatted email containing only the info that should be seen? For example, clear-text password emailing is not something I want to do. And timestamps aren’t particularly user friendly.

I’m assuming that the array dumped to email is the same array that would be POSTed to a target URL. Correct? Does that mean I should create a page on my website with a shortcode that calls the correct processing code? How should that page be protected?

Posted: Wednesday Sep 26th, 2012 at 3:49 am #26520
Raam Dev
Username: Raam
Staff Member

If you want to create your own script that generates a custom report, you’ll need to use the Notification URLs feature.

You would create a PHP script for the specific notification (e.g., signup-notification.php) and then put the URL to that script in the Notification URL box. To pass information to the script, you’ll use query string variables and the Replacement Codes described below each of the Notification URL boxes.

For example, to pass the First Name, Last Name, and Email to your script, you’d add ?fname=%%first_name%%&lname=%%last_name%%&email=%%payer_email%% to the end of your URL, so that the full URL you paste into the Notification URL box looks something like this:

http://example.com/signup-notification.php?fname=%%first_name%%&lname=%%last_name%%&email=%%payer_email%%

Then inside your signup-notification.php script, you would access those three pieces of information through $_GET[‘fname’], $_GET[‘lname’], and $_GET[’email’].

Posted: Wednesday Sep 26th, 2012 at 6:47 am #26535

hmm. okay, I can do that. But it occurrs to me that it might be easier to just apply a filtre to the s2member function that sends the api notification logging email. Which function is that?

Posted: Saturday Sep 29th, 2012 at 7:09 pm #26974
Raam Dev
Username: Raam
Staff Member

Thank you for your patience.

I looked into this a bit more and confirmed with Cristian. It looks like the Notification API emails are not centralized anywhere, i.e., they are triggered in the code wherever the specific event takes place (so Modification API emails would take place in the code where the modification itself is happening).

We know this isn’t very modular or extendable and we’re working to improve this in the next major release of the plugin.

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