Integrate Patreon with Drama-Otaku
Amrayu78
We have some users that are subscribed to Patreon, these are the VIPs on the site.
They have no ads shown to them.
Currently I'm manually updating this, so if someone unsubscribes, they are still VIP on the site.
I'd like to create an integration between Patreon and Drama-Otaku.
If a user subscribes to patreon, their account is auto-updated on Drama-Otaku and their role becomes VIP.
If a user unsubscribes to patreon, their account is auto-updated to subscriber and they will see ads again.
This is part of a bigger feature related to the points and coins system I briefly mentioned.
Amrayu78
Max Romanchenko This is part of a bigger feature related to the points and coins system.
Max Romanchenko
Amrayu78 I can integrate Patreon with the site so that user roles update automatically: VIP when subscribed, Subscriber when unsubscribed. To do this, you will need to create a Patreon App in your Patreon creator account.
That is, there are two types of integration:
- instant (via webhook)
- every 2-3 hours (cron task)
I think the first option via webhook is preferable.
Below are instructions for integration via Webhook.
______________
Patreon > Drama-Otaku Integration Setup (Webhook version)
Log in to your Patreon creator account.
Go to Settings → API & Webhooks → Clients & API Keys.
Create a new Patreon App. Give it a name (e.g. Drama-Otaku Integration).
Copy the following and send them to me (please send by email for security reasons):
- Webhook Secret
In the same App settings, add a Webhook:
URL: https://drama-otaku.com/wp-content/themes/drama-otaku/tools/patreon_sync.php
Events: members:create, members:update, members:delete
Save it.
That’s it - I will connect everything on the site.
Important: The email address a user has on Patreon must match the email they use on Drama-Otaku for their account to be updated correctly.
Amrayu78
Max Romanchenko Sent you the details via email!
Amrayu78
Max Romanchenko: What do I need to do to test this? Thanks.
Max Romanchenko
Amrayu78 Sure! To test the integration, here's what you can do:
To test VIP activation:
- Subscribe to the VIP tier on Patreon using any test account.
- Make sure the email used on Patreon matches the one on Drama-Otaku.
- Within a few minutes, your role on Drama-Otaku should automatically change to VIP Member (no ads).
To test VIP removal:
- Cancel or downgrade your Patreon subscription.
- The system will detect the change and update your role to Subscriber.
- Ads should reappear on the site for your account.