Contact Form

This use case will show you how to create contact form for your website. This website uses contact form created by RapidForge.

Lets create page using drag and drop editor. You can see page created in contact-form page.

We should create endpoint for form to be submitted. Lets create POST endpoint called /webhook/feedback inside of the block and add the following script.

# Create JSON payload
# FORM_<name> is injected by RapidForge from form fields
# You can access request body using PAYLOAD_DATA
payload=$(cat <<EOF
{
  "content": "$FORM_COMMENT"
}
EOF
)

# Send the message to Discord DISCORD_WEBHOOK is environment variable set in BLOCK SETTINGS
curl -H "Content-Type: application/json" -X POST -d "$payload" "$DISCORD_WEBHOOK"

This script basically decodes form data and sends it to Discord. You can change this script to send data to any other service. Contact form is included in page via iframe.