Actions
Actions are triggered afer a successful transaction. You can use them to send customer and admin emails from your site, update entries and add members to Subscriptions.
Setup
Setting up a new Action is simple. In the EE CP, visit the Charge addon view, then the Actions tab. You can create a new action from there. You'll see a screen like this :
Options
Actions have the following options:
Emails
-
Options to send an email to customer and admins. Set options for subject, template and email addresses as appropriate.
In the email template body and subject all the variables from
{exp:charge:info}
are available.
Note: Emails can also be sent directly from Stripe. Set that in your Stripe dashboard.
Update Entry
-
Options to update an entry. The entry must be editable by the current user.
Requires a param of '
on_success:entry_id
' or 'on_success:url_title
' to be included on the{exp:charge:form}
tag.All entry fields can be updated by passing values via '
on_success:field_name
' where field_name is the name of the field. (ie. 'title', 'transaction_hash' etc..)
Add Member to Subscription
-
Adds the current member to a subscription. Great to control a user's member groups and recurring emails based on their payments.
Usage
Once you've setup your action all that's needed is to add a value of 'on_success="action_shortname"
', where action_shortname is the shortname you set when you created the action.
For example, if we've created an action called 'Email All', with a shortname of 'email_all', you'd simply need to do the following :
{exp:charge:form
on_success="email_all"}
..
{/exp:charge:form}
After a successful payment the action will be triggered.