Skip to content

Plugins

Nicholis edited this page Jun 21, 2024 · 4 revisions

You can create plugins to extend SnowMail in the following ways:

  • Add customized inputs (e.g. a captcha)
  • Validate forms with more advanced validation criteria than SnowMail supports
  • Send contact form submissions through a transactional email service provider (e.g. SendGrid) instead of SMTP
  • Send contact form submissions through a webhook
  • Run code whenever a form is saved (useful for triggering a website build)

Place plugin JARs in data/plugins and restart SnowMail.

Some plugins that add custom inputs have a settings form. Fill out all required fields in this form before saving.

firefox_7Q3QEMD4B6

For information on creating your own plugins, see Developing Plugins.

Official Plugins

A few official plugins are published alongside SnowMail.

Important

Keep these plugin versions in sync with SnowMail to avoid issues.

ReCAPTCHA

This plugin adds a captcha widget and validation code for reCAPTCHA.

To use, add the reCAPTCHA input to the form and fill out the settings form.

SnowCaptcha

This plugin adds a captcha widget and validation code for SnowCaptcha.

To use, add the SnowCaptcha input to the form and fill out the settings form.

Webhook

This plugin sends a POST request to the URL of your choice. After installing the plugin, a config file will be created in data/plugins/Webhook. Modify the config file as needed and restart SnowMail.

The requests will have a JSON body:

  • submit event:
{
  "type": "submit",
  "values": {
    // "input-name" will be the name of the input
    "input-name": {
      "input": {
        // Input object
      },
      // The value as a string
      "value": "Lorem ipsum"
    }
  }
}
  • save event:
{
  "type": "save",
  "form": {
    // Form object
  }
}
Clone this wiki locally