All guides

Hugo

Use a shortcode to put the same contact form in your Markdown pages.

Copy your endpoint

Open your form in Wiztrom and copy its endpoint from Setup. Replace the example URL with that address. If you created your form from a template, use the field names and required fields from its Setup HTML.

Create a shortcode template

Save this as layouts/_shortcodes/contact.html in current Hugo. Older sites that use the pre-0.146 template layout keep shortcodes under layouts/shortcodes/.

HTML
<form action="https://forms.wiztrom.com/f/YOUR_FORM_ID" method="post">
  <label>Name <input name="name" required /></label>
  <label>Email <input name="email" type="email" required /></label>
  <label>Message <textarea name="message" required></textarea></label>
  <button type="submit">Send message</button>
</form>

Call the shortcode from content

Open a content page such as content/contact.md and put the shortcode below its front matter. Run hugo server, check the page, then rebuild the published site.

Hugo
{{< contact >}}

Find the test in your inbox

On the published page, leave a required field empty and try Send. Fill it in, enter a distinctive test message and submit once. Open the form’s Wiztrom inbox and match the submitted values. If you enabled a notification, open delivery history and check its result.

References