Adds Discord Embed on Form Submission#39
Merged
Merged
Conversation
Adds webhook option on form creation, and adds validation. Updates `SCHEMA.md`. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Fixes a bug that would force you to do a dummy webhook object when creating a form. Fixes a bug that would force you to add an empty message for webhooks. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Builds and sends a discord webhook on form submission. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> # Conflicts: # backend/routes/forms/submit.py
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
# Conflicts: # backend/routes/forms/submit.py
jb3
requested changes
Dec 18, 2020
Member
jb3
left a comment
There was a problem hiding this comment.
Initial review pass. Functionality all looks good and is what I was expecting, nice work!
Co-authored-by: Joe Banks <joseph@josephbanks.me>
Uses builtin user formatting for username and mentions. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Moves the validation code of webhook urls to an async function that is called by the route, to avoid blocking code. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Adds better parsing and formatting for webhook message variables, and documents them in SCHEMA.md. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> # Conflicts: # backend/routes/forms/submit.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes this notion ticket.
Important to do note
The webhook links to a frontend URL that displays the form response, which is currently not supported. The frontend URL was added to environment variables in preparation, but the actual viewing URL will have to be added in place of the placeholder once available.
Description
Implements discord webhooks for form submission. This allows forms to have an optional webhook, that will contain information about submissions, along with an optional message.
Screenshots
Regular authenticated form.
User object is unavailable (likely due to the form not requiring login).
Message example. Can add mentions for users and roles (See example in schema).