form-to-slack

command module
v0.0.0-...-ae6ffbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 0

README

form-to-slack

Sends form submission to Slack.

Requirements

  • Go
  • Secret key for a reCAPTCHA-compatible service
  • Slack Webhook URL

Installation

$ docker buildx build .
# Port number (required)
export PORT=8080

# TLS certificate and private key (optional; if not specified, form-to-slack is served over HTTP)
export TLS_CERT=/path/to/tls/cert
export TLS_KEY=/path/to/tls/key

# reCAPTCHA verify endpoint (optional; if not specified, it defaults to reCAPTCHA)
export RECAPTCHA_URL=https://www.google.com/recaptcha/api/siteverify

# reCAPTCHA secret key (required)
export RECAPTCHA_SECRET=

# Slack Webhook URL (required)
export SLACK_WEBHOOK_URL=

# Access-Control-Allow-Origin (optional; space-separated)
export ALLOWED_ORIGINS=

Usage

<form>
    <!-- https://developers.google.com/recaptcha/docs/v3 -->
    <input type="hidden" name="g-recaptcha-response" />
    <input type="text" name="name" placeholder="Your Name" required />
    <input type="text" name="subject" placeholder="Subject" required />
    <input type="text" name="email" placeholder="E-mail Address (optional)" />
    <textarea name="body" placeholder="Body" required></textarea>
</form>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
application
infrastructure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL