Jekyll form to email

Jekyll and GitHub Pages serve static files only, so a form needs somewhere else to send its data. Point it at FormDoc and each submission arrives in your inbox.

1. Create an include

Save this as _includes/formdoc.html and replace the key with yours from app.formdoc.dev/new:

<form action="https://api.formdoc.dev/v1/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="fd-name">Name</label>
  <input type="text" id="fd-name" name="name" autocomplete="name" required>

  <label for="fd-email">Email</label>
  <input type="email" id="fd-email" name="email" autocomplete="email" required>

  <label for="fd-message">Message</label>
  <textarea id="fd-message" name="message" rows="5" required></textarea>

  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>

2. Add it to a page

In any page, post or layout:

{% include formdoc.html %}

Jekyll’s default Markdown renderer passes HTML through, so you can also paste the form straight into a Markdown page.

Next