NOTE: This document is intended for developers.
RafflePress has an Invent Your Own action which lets you create custom actions that RafflePress does not have out of the box. This guide will show you how to programmatically complete these actions.
In this example, we will create a custom action that users get entires in exchange for completing a survey form.
- Create the action in RafflePress
Note: If you need to hide the action from the user you can get the class id of the action and add custom css to hide. Example: .rafflepress-action-9chrxc{display:none} - Next, get the giveaway id which can be found in the URL while viewing the giveaway in the admin area.
- Next, get the action id which you can get in the URL while editing the action.
- Finally, review the code in this sample plugin below available in our GitHub repository.
https://gist.github.com/seedprod/b8abe1d0076c4281e6e19a679baacaaeThis plugin requires the giveaway_id, action_id, and email parameters. It contains two code samples: one adds a user, and the other programmatically complete an entry.With this plugin active, we would call this action when the Survey is completed to programmatically complete the entry.