Usage

Request Parameters

Send a POST request to https://forms.yourdomain.com/send with the following parameters:

NameValue
_recipientThe recipient email address for this contact form.
_redirect_successThe URL to redirect to after a successful form submission. (optional)
_sender_nameThe sender name for this contact form. (optional)
_sender_emailThe sender email address for this contact form. (optional)
_subjectThe subject line for this contact form. (optional)
_hp_emailIf this field is filled in then a 422 error will be returned. (optional)
_fileAn input file which will be attached to the email (optional)

Important:

Any fields starting with _ will not be included in the email body.

The _recipient must be added to the allow list in your .env file to be valid.

The _hp_email field acts as a honeypot field to prevent spam submissions.

You can include any other parameters to be included in the generated email.

Example Forms

You can see some example forms below ranging from super basic to much more advanced (coming soon).

Basic Example

<form action="https://forms.yourdomain.com/send" method="POST">
  <input type="hidden" name="_recipient" value="someone@clientwebsite.com">
  <input type="hidden" name="_redirect_success" value="https://clientwebsite.com/success/">
  <input type="text" name="_sender_name" placeholder="Your Name">
  <input type="email" name="_sender_email" placeholder="Your Email">
  <input type="text" name="_subject" placeholder="Your Subject">
  <textarea name="Message" placeholder="Your Message"></textarea>
  <input type="submit" value="Send">
</form>

File Example

<form action="https://forms.yourdomain.com/send" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="_recipient" value="someone@clientwebsite.com">
  <input type="hidden" name="_redirect_success" value="https://clientwebsite.com/success/">
  <input type="text" name="_sender_name" placeholder="Your Name">
  <input type="email" name="_sender_email" placeholder="Your Email">
  <input type="text" name="_subject" placeholder="Your Subject">
  <textarea name="Message" placeholder="Your Message"></textarea>
  <input type="file" name="_file">
  <input type="submit" value="Send">
</form>

Formgate will attach any file that is uploaded to the server. You should use the HTML accept attribute to limit what can be uploaded.