summaryrefslogtreecommitdiff
path: root/views/account_webhook.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-05-06 20:30:33 +0200
committerTor Andersson <tor@ccxvii.net>2025-05-06 20:45:32 +0200
commit6ae417c0be86a44b6dfeb7537da1f9b70a288950 (patch)
treef149b0423f52c46a152ff032e0a20abbb1d3191b /views/account_webhook.pug
parent644c287eede443c608eeab0cc6cd41da228947e3 (diff)
downloadserver-6ae417c0be86a44b6dfeb7537da1f9b70a288950.tar.gz
Rename pug files to match access url.
Diffstat (limited to 'views/account_webhook.pug')
-rw-r--r--views/account_webhook.pug68
1 files changed, 68 insertions, 0 deletions
diff --git a/views/account_webhook.pug b/views/account_webhook.pug
new file mode 100644
index 0000000..b9817ef
--- /dev/null
+++ b/views/account_webhook.pug
@@ -0,0 +1,68 @@
+//- vim:ts=4:sw=4:
+doctype html
+html(lang="en")
+ head
+ include head
+ title Webhook
+ body
+ include header
+ article
+
+ h1 Webhook
+
+ - var url = webhook && webhook.url || ""
+ - var format = webhook && webhook.format || ""
+ - var prefix = webhook && webhook.prefix || ""
+
+ form(action="/account/webhook/update" method="post")
+ if webhook && webhook.error
+ p.error ERROR: #{webhook.error}
+ p Webhook URL:
+ br
+ input#url(type="text" name="url" size=120 placeholder="https://discord.com/api/webhooks/..." value=url required)
+ p Webhook format:
+ br
+ input#format(type="text" name="format" size=40 placeholder="content" value=format)
+
+ p Message prefix:
+ br
+ input#prefix(type="text" name="prefix" size=40 placeholder="<@123456789>" value=prefix)
+
+ if webhook
+ button(type="submit") Update
+ else
+ button(type="submit") Create
+
+ if webhook
+ form(action="/account/webhook/delete" method="post")
+ button(type="submit") Delete
+
+ h2 Discord Notifications
+
+ p You can send notifications to a given channel on a Discord server.
+
+ ol
+ li Create your own server or use an existing server where you have administrator privileges.
+ li <a href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks">Get the webhook URL</a> for the Discord channel and enter it into the Webhook URL field.
+ li Enter "content" into the Webhook format field.
+ li Find your <a href="https://support.playhive.com/discord-user-id/">Discord User ID</a>. This is not your username, it is a number.
+ li Enter your Discord User ID into the Message prefix field as "&lt;@12345&gt;".
+
+ h2 Slack Notifications
+
+ p You can send notifications to a Slack workspace.
+
+ ol
+ li Join or set up a Slack workspace with a webhook integration.
+ li Find the Webhook URL and enter it into the Webhook URL field.
+ li Enter "text" into the Webhook format field.
+ li Find your <a href="">Slack User ID</a>. This is a number with "U" in front of it.
+ li Enter your Slack User ID into the Message prefix field as "&lt;@U12345&gt;".
+
+ h2 Custom Notifications
+
+ p.
+ You can integrate with any server that accepts inbound webhooks by setting the webhook URL to the appropriate endpoint.
+ If the format field is blank, the payload is sent as plain text.
+ Otherwise, the payload is a JSON object where the format field specifies which JSON property holds the message.
+ Use "content" for Discord and "text" for Slack.