# Contact Form

**URL:** https://meta.discourse.org/t/contact-form/305462
**Category:** Plugin
**Created:** [April 25, 2024, 5:33pm UTC](https://meta.discourse.org/t/contact-form/305462 "2024-04-25T17:33:35Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [April 25, 2024, 5:33pm UTC](https://meta.discourse.org/t/contact-form/305462/1 "2024-04-25T17:33:35Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Adds a contact form to the top of any topic tagged `contact`. Information submitted through the form will be sent to the group or category configured to receive it. |
| 🛠 | **Repository Link** | [https://github.com/jericson/discourse-contact-plugin](https://github.com/jericson/discourse-contact-plugin) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### Features

When enabled, the Contact Form plugin places a contact form at the top of any topic tagged `contact`. Data submitted via the form is sent to a category or group configured to receive mail from `contact_form_email`.\[1\] Like traditional contact forms, there is no requirement to have an account on the site in order to submit.

Here’s what a visitor might see:

 ![Screenshot 2025-07-23 at 5.27.59 PM](https://global.discourse-cdn.com/meta/original/4X/0/9/d/09d909f6d01f8334848521905e5ac9540e66a9cf.png)

Note that this is a regular post that can have any instructions you might want to include in the body.\[2\] Currently the field names are hardcoded and no real validation is done, but see the [TODO section](https://meta.discourse.org/t/contact-form/305462#todo-7) below. After the message is sent, it will show up in the configured group’s message feed:

 ![Screenshot 2025-07-23 at 5.45.41 PM](https://global.discourse-cdn.com/meta/original/4X/3/9/f/39f92838306f16fa85736317464cd9ada0f94087.png)

Depending on how their email notifications are configured, members of the configured group may also receive an email from Discourse:

 ![Screenshot 2025-07-23 at 5.43.45 PM](https://global.discourse-cdn.com/meta/original/4X/6/0/6/606ef108cdf913266a0c4d868fd2fb596c7ac5d9.png)

### Configuration

In order to use this plugin, you must [configure incoming email to create new topics or group messages](https://meta.discourse.org/t/configure-incoming-email-to-create-new-topics-or-group-messages/62977). It isn’t required to [set up reply by email](https://meta.discourse.org/t/troubleshoot-reply-by-email/42026) since the plugin doesn’t actually send email. It hijacks the API to simulate incoming mail. (That said, reply by email is a useful feature!)

In particular, this plugin requires:

- `email_in` and
- `enable_staged_users`

to be enabled.

Once enabled, any topic tagged `contact` will have a contact form added to the `topic-above-posts` plugin outlet.

#### Send to a group

Since people will use this form to submit their personal information, sending the results to a closed group is the safest option.

1. Create a new group for the people who will be handling contacts. (I usually call it “Contact” for simplicity, but it could be anything including an existing group.)
2. Add members who will be receiving contact information.
3. **Do not** check any of the access options. This should be a closed group.
4. Change the visibility of the group as reasonable for your organization.
5. Set the “Custom incoming email address” to be the same as the `contact_form_email` setting. (By default, this is “[contact@example.com](mailto:contact@example.com)”.)

 ![Screenshot 2025-07-23 at 5.47.25 PM](https://global.discourse-cdn.com/meta/original/4X/c/6/9/c692c9753807c2c649411bef616f4a70372ae733.png)

…

 ![Screenshot 2025-07-23 at 5.47.48 PM](https://global.discourse-cdn.com/meta/original/4X/2/3/c/23cbb620db06b0d220f3aa69edc40dc3873c2d66.png)

#### Send to a category

Sending to a category is also possible using the “Custom incoming email address” category setting. Be sure to enable “Accept emails from anonymous users with no accounts” as well.

**Sending to a category is not recommended for contact information, however!** If by some chance the access permissions on the category are changed, it could expose personal information to people (or search engines) that shouldn’t have access. It’s much less likely to happen if contacts are sent to group messages instead.

#### Limiting who can add contact forms

It could be quite odd to have contact forms sprouting up hither and yon, so you might want to limit who can use the `contact` tag. In order to do that, create a new tag group:

1. From the `/tags` page, select the wrench in the top right corner.
2. Select “Manage Tag Groups” and then select " ➕ New Group".
3. Fill in an appropriate name (e.g., “Staff only”), add the `contact` tag and select “Tags are visible to everyone, but only the following groups can use them”.
4. Pick the group you want to allow to add a contact form (usually “staff” or “admins”) and save the tag group.

### CHANGELOG

- April 25, 2024: Alpha release.

### TODO

- I’d like to set up tests to make sure nothing breaks when I make changes. I particularly want to verify that people without accounts can submit their data.
- While testing I discovered a major data leak. I removed that particular vulnerability, but I could really use some help testing.
- The form doesn’t do any validation. The only real requirement is that the email field look like an email. If someone leaves a response without adding an email, the form quietly fails.
- There is no protection against spam or abuse.
- Code is very much `my-first-plugin` quality based on examples that used outdated conventions. Any suggestions about style are welcome.
- I like having the contact form associated with a topic tagged “contact”, but it’s convoluted and probably unnecessary. I’m considering adding a new route that’s just the contact form for simplicity.
- The contact data is stored in the database, but it might be helpful to have an admin panel to see a list of contacts.
- The form is fixed to my current requirements, but it would be handy to have some flexibility about what fields it prompts for.

* * *

1. That setting defaults to “[contact@example.com](mailto:contact@example.com)” but can be configured to accept real emails. 

2. It’s even possible to reply to the contact form, for better or worse.

---

<div class="post-metadata">

### Author: ![Cate\_Soule](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cate_soule/32/492770_2.png) [@Cate\_Soule](https://meta.discourse.org/u/Cate_Soule)
#### Post date: [July 22, 2025, 6:37am UTC](https://meta.discourse.org/t/contact-form/305462/2 "2025-07-22T06:37:38Z")

</div>

The repository link isn’t working. Can you update @jericson

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [July 22, 2025, 7:48am UTC](https://meta.discourse.org/t/contact-form/305462/3 "2025-07-22T07:48:26Z")

</div>

Working for me.

---

<div class="post-metadata">

### Author: ![Cate\_Soule](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cate_soule/32/492770_2.png) [@Cate\_Soule](https://meta.discourse.org/u/Cate_Soule)
#### Post date: [July 22, 2025, 9:59am UTC](https://meta.discourse.org/t/contact-form/305462/4 "2025-07-22T09:59:30Z")

</div>

![Screenshot 2025-07-22 at 5.58.26 PM](https://global.discourse-cdn.com/meta/original/4X/2/7/0/2708755a15fb597c5de284bd6922cebfd198f3da.jpeg)

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [July 22, 2025, 10:05am UTC](https://meta.discourse.org/t/contact-form/305462/5 "2025-07-22T10:05:38Z")

</div>

It’s not a theme, it’s a plugin. See [Install plugins on a self-hosted site](https://meta.discourse.org/t/install-plugins-in-discourse/19157).

---

<div class="post-metadata">

### Author: ![Cate\_Soule](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cate_soule/32/492770_2.png) [@Cate\_Soule](https://meta.discourse.org/u/Cate_Soule)
#### Post date: [July 22, 2025, 12:48pm UTC](https://meta.discourse.org/t/contact-form/305462/6 "2025-07-22T12:48:07Z")

</div>

Solved.

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [July 22, 2025, 1:25pm UTC](https://meta.discourse.org/t/contact-form/305462/7 "2025-07-22T13:25:44Z")

</div>

Good deal! It might help future readers to know what solved it for you.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [July 22, 2025, 1:35pm UTC](https://meta.discourse.org/t/contact-form/305462/8 "2025-07-22T13:35:48Z")

</div>

Not installing the plugin as a theme I’d guess 😉

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 23, 2025, 8:09pm UTC](https://meta.discourse.org/t/contact-form/305462/9 "2025-07-23T20:09:08Z")

</div>

Can you post some ss of the plugin in action? Can the “Contact Form” be modified/configured?

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [July 24, 2025, 12:50am UTC](https://meta.discourse.org/t/contact-form/305462/10 "2025-07-24T00:50:37Z")

</div>

> [@Heliosurge](#):
>
> Can you post some ss of the plugin in action?

Sure thing! See the edited post.

> [@Heliosurge](#):
>
> Can the “Contact Form” be modified/configured?

Sadly no. But [PRs are welcome](https://github.com/jericson/discourse-contact-plugin)!

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 24, 2025, 12:56am UTC](https://meta.discourse.org/t/contact-form/305462/11 "2025-07-24T00:56:14Z")

</div>

Pretty cool plugin. The spoofed email address doesn’t show to end user I presume.

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [July 24, 2025, 1:03am UTC](https://meta.discourse.org/t/contact-form/305462/12 "2025-07-24T01:03:15Z")

</div>

Correct. I have [another plugin](https://github.com/jericson/discourse-review-plugin) (even more rough than this one) for getting anonymous reviews. I use `review@example.com` to route those messages to the proper destination. It’s just a string.

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [April 30, 2026, 12:35am UTC](https://meta.discourse.org/t/contact-form/305462/13 "2026-04-30T00:35:36Z")

</div>

I recently [updated the plugin](https://github.com/jericson/discourse-contact-plugin) because it was failing on recent versions of Discourse.
