As of version 1.5 of USP Pro, it’s possible to receive a copy of the submitted post as an email to the specified address. For example, if you are collecting job applications via USP Form, the submitted content will be stored as a post in the database and sent to you via plain-text email.

Video Tutorial

Written Tutorial

Here is the magic code required to make a combination submit-post/contact form:

<input name="usp-is-post-submit" value="1" type="hidden">
<input name="usp-is-contact" value="1" type="hidden">

Add those two lines to any USP Form to enable both submitting of posts and sending of email (i.e., contact form). Of course, the form won’t make sense or work correctly without the following fields:

  • Email field — required for sending email
  • Name field — required for submitting posts
  • Title field — required for submitting posts
  • Content field — required for submitting posts

So you want to make sure those fields are included in your form. Let’s take a look at a concrete example..

Example of Combo Submit/Contact Form

To illustrate, here is a copy/paste-able example to get you started:

[usp_email]
[usp_subject]
[usp_name]
[usp_title]
[usp_content]

<input name="usp-is-post-submit" value="1" type="hidden">
<input name="usp-is-contact" value="1" type="hidden">

Just add that to any new USP Form and you should be good to go. To customize the shortcodes, you can use a variety of attributes. Here is a complete list of all USP shortcodes and attributes.

Adding Custom Fields to the Combo Form

This works just like with any other USP Form, you just add the custom fields as usual, for example:

[usp_email]
[usp_subject]
[usp_name]
[usp_title]
[usp_content]

[usp_custom_field form="1" id="1"]
[usp_custom_field form="1" id="2"]
[usp_custom_field form="1" id="3"]

<input name="usp-is-post-submit" value="1" type="hidden">
<input name="usp-is-contact" value="1" type="hidden">

Here we have added three custom fields with ids of 1, 2, and 3. This information will be:

  • Attached to the submitted post as custom fields
  • Included in the email as “Additional Information”

Learn more about adding custom fields to USP Pro Forms, and displaying custom fields in post content on the front-end of your site.

Note: you can disable the custom fields from appearing in the email by disabling the plugin setting, USP Pro ▸ Contact Form ▸ Include Custom Fields.

Related