The Magic Button trigger enables users to simply click a button to complete a trigger in a Logged-in recipe. It’s like a custom WordPress button that do almost anything you want it to – no custom code or programming required!
There are a couple of ways to use this button:
- Create a recipe with a single trigger (the Magic Button). Clicking the button immediately runs the recipe’s actions on the user. This enables you to give users a button that can do anything Automator has an action for, or even execute multiple actions (enrolling the user in a course, sending them an email, adding a new role, etc.).
- Create a recipe with multiple triggers (including one or more Magic Buttons). Clicking the button indicates the user has completed one of the recipe’s requirements, and the recipe’s actions run when the user has completed all triggers. This enables you to create triggers for behaviors that Automator doesn’t support natively, by allowing users to self-complete a trigger in a multi-trigger recipe.
Using the Magic Button
Generating a Magic Button is as simple. The trigger can be found under WordPress > User clicks a magic button (for any Logged-in recipe; the Magic Button isn’t supported in Anonymous recipes as Automator would not know who clicked the button):
The trigger has no options. It simply provides a shortcode that can be placed wherever the button should appear:
By default, the button label is “Go”, but that can be changed by adding a label attribute to the shortcode. For example, to change the label of the button in the screenshot above, you could use:
[automator_button id="4537" label="Click Me!"]
Clicking the button will reload the page the user is on. That could be a confusing user experience, as there won’t be any visual confirmation that the button was clicked or the actions have been completed. So in the recipe containing the button, we recommend checking Redirect when recipe is completed to take the user to a page that describes what actions have been completed and suggests next steps.