fs-mautic-hooks
is a webhook receiver for Freemius that will update Mautic contacts on specified webhook events.
This is intended to be used with the fs-mautic-sync initial sync script to set up the custom fields in Mautic and do an initial sync of the plugin users.
This script is formatted as a Google App Engine app but could be adapted to work on different serverless platforms (or just a good ole lamp server). Feel free to fork.
- Uses secure Mautic oAuth2 authentication
- Creates or updates Mautic contacts and companies when:
- A new plugin user is created
- The plugin is installed on a new site
- The plugin is deactivated/uninstalled
- The plugin plan is changed
- The user opts in/out of the beta program
- The user opts in/out of marketing emails
- The user is accepted as an affiliate
- The PHP, WordPress or plugin version are updated
- gcloud cli must be installed in PATH
- App engine app must be configured in your cloud project
- Clone the repository
- Create a new
config.php
file in the root directory based onconfig.sample.php
- Modify the
app.yaml
to suit your needs - Run
gcloud app deploy
to deploy the app to Google App Engine - Navigate to
https://path-to-your-app-engine-app.appspot.com/authorize
to initialize the oAuth flow - Add a new webhook in Freemius, pointing to
https://path-to-your-app-engine-app.appspot.com/?token=the-token-you-defined-in-config.php
- Try clearing the Mautic cache if the API is giving you issues