---
title: "Connect Docusaurus forms to email"
canonical: "https://glueforms.com/docs/connect-docusaurus"
language: "en"
description: "Create a Docusaurus contact page with Layout and send form submissions to email through GlueForms."
---

# Connect Docusaurus forms to email

Add a contact page alongside your documentation. The form posts directly to GlueForms, so your Docusaurus site can stay static.

## Create the contact page

1. In GlueForms, open [Forms](https://glueforms.com/app/forms), choose your form and copy its receiving URL. Select your form above, or replace `YOUR_FORM_URL` in the example.
2. Create `src/pages/contact.tsx` in your Docusaurus project. The `Layout` wrapper keeps your site navigation and footer.

```javascript
import Layout from '@theme/Layout';

export default function Contact() {
  return (
    <Layout title="Contact us">
      <main className="container margin-vert--lg">
        <h1>Contact us</h1>
        <form action="YOUR_FORM_URL" method="POST">
          <label>
            Name
            <input name="name" autoComplete="name" />
          </label>
          <label>
            Email
            <input name="replyto" type="email" autoComplete="email" required />
          </label>
          <label>
            Message
            <textarea name="message" rows={4} required></textarea>
          </label>
          <button type="submit">Send message</button>
        </form>
      </main>
    </Layout>
  );
}
```

Docusaurus creates a page from this file. Open the contact page in your site preview before publishing it.

After acceptance, the browser opens the [thank-you page](https://glueforms.com/docs/thank-you-page) with status `200`, or follows a `303` [redirect](https://glueforms.com/docs/redirects) to the HTTPS URL saved in your form’s settings. With [JavaScript](https://glueforms.com/docs/javascript), request JSON and show your own confirmation after `accepted: true`. JSON receipts do not redirect automatically. The `replyto` field explicitly sets the address for replies to the notification.

Publish the page, submit the form and open the saved message in GlueForms to check the fields and email notification.

[Docusaurus page documentation](https://docusaurus.io/docs/creating-pages).
