Article Contents Related Articles Tags
  • No tags found.
Was This Helpful? Last Updated
  • 2012/10/03

Custom Action Overview

Custom actions allow you to either send an e-mail or run a PHP script when a specific task occurs in the program.

Triggers

Possible triggers for a custom action include:

  • Login
  • Logout
  • Cart Purchase
  • Allows you to select a specific product that will trigger the action.
  • Registration Complete
  • Allows you to select a specific registration form that will trigger the action.

So if you select "Cart Purchase", the custom action will only run when a product is purchased through the shopping cart (this does not include a purchase through a registration form). Optionally, you can specify an exact product that would need to be purchased for the action to trigger.

Creating A Custom Action

To create a custom action, do the following from the admin control panel:

  • Click on "Settings » Custom Actions"
  • Click on "New"
  • Select your desired settings for the custom action.
  • Click on "Create Custom Action"

Settings: E-Mail Type

Compose this like you would any e-mail. Note that if you place the caller tag "%user%" in either the "From" or "To" field, the e-mail will arrive "From" the user's e-mail address, or go "To" the user's e-mail address. So to send an e-mail to the user who just triggered the custom action, input "%user%" into the "To" field.

Settings: PHP Include Type

Your script must be valid PHP and the file must have extension ".php. You should also never "exit;" a PHP script running as a custom action, as this will end execution of Member Guardian.

Please note that you may also need to create a writable folder named "digitalfiles" in the "members/admin" folder to upload custom actions to your server.

Under the "Custom PHP Code Inclusion" section, either input the path to the PHP file on your server that you wish to run when the custom action triggers, or select "Upload the File" if wish want to upload your PHP script to the server.

Technical Specs

Click here for technical specifications concerning PHP-include custom actions.