Custom actions allow you to run PHP code or send out an e-mail when a specific task is triggered.
"Settings > Add A Custom Action"
Triggers
You can run a custom action any time a user does any of the following actions:
- Login
- Logout
- Cart Purchase
- Including when a specific product is purchased
- Registration Processed
- Including when a specific form is submitted
- Lead Generated
- Including when a specific form is submitted
- Digital Product is Downloaded
- Event Registration is Processed
PHP Includes
The program will always pass the following information to your custom action:
$user $components
$user represents the username of the account that triggered the action. Since an active MySQL connection is present on all custom actions, you can retrieve a user's account information as follows:
$user_primary_info = mysql_fetch_array(mysql_query( "SELECT * FROM `ppSD_members` WHERE `username`='" . $user . "' LIMIT 1" )); $user_secondary_info = mysql_fetch_array(mysql_query( "SELECT * FROM `ppSD_members_fields` WHERE `username`='" . $user . "' LIMIT 1" ));
$components is an array that sends pertinent information about the custom action, such as order numbers, download details, etc.. You can test what information is passed back by adding this code to your custom action:
print_r($components);
Any function present on functions_general.php can be used in a custom action.
E-Mails
You can create as many custom e-mails as you wish using this feature. Simply input the recipients and e-mail information, select your e-mail options, and the program will take care of the rest!
If you wish to send an email to the user who triggered the action, input %user% into the "To" line of the email.
Last updated on 7 July 2011 2:35pm
