Virginia Tech® home

How Do I ... Create Email Forms In Ensemble

Ensemble supports form creation through the HTML component and through the use of a PHP email page which appears to be hosted as an Ensemble page. Custom PHP is not supported in Ensemble.

You can either generate a form from scratch or you can take a already developed form and add the required fields.

If you need to use PHP other than the generic recaptcha mailer, you will want to maintain a second host using the Web Hosting service.

Our form email script uses a Google recaptcha component to dramatically curtail the amount of spam originated from forms. Recaptchas are small challenges which are used to determine whether one is a bot like a spammer or a human. Early generations asked users to decipher a word and also do some small amount of work for Google. For example, one might be asked what one word is to prove you are a human and another to assist in providing optical character recognition for a book or google maps. Newer versions of captchas might ask you to click a box to prove you are not a robot or may work entirely invisibly.

All internal links on Ensemble will automatically use https and not http. For links outside of Ensemble, we strongly suggest that you test TLS support and use https if supported.

There is a limit of 50 input fields on this remailer.

In the email itself form fields are sorted alphabetically by name. You may want to add numbers padded with zeros to begin the names of optional form fields to generate them in a specific order.

The HTML for a form should look something like this:

<form method="post" action="https://vt.edu/mailer/generic-recaptcha-mailer.php" id="unique-guid-for-tracking">
<!-- required: secure post method to this fully qualified domain name and path -->

<input type="hidden" name="email" value="form.creator@vt.edu">
<!-- required field: @vt.edu email that the form fields should be emailed to -->
<!-- can use multiple @vt.edu addresses separated by commas -->

<input type="hidden" name="from" value="form.creator@vt.edu">
<!-- optional field: @vt.edu email that the form fields should be emailed from -->

<input type="hidden" name="replyto" value="alternate.person@vt.edu">
<!-- optional field: set the @vt.edu replyto if different than "from" -->

<input type="hidden" name="subject" value="Event Submission Form">
<!-- optional field: set the subject on the email -->

<input type="hidden" name="redirect" value="https://server.vt.edu/path/to/redirect.html">
<!-- optional field: path to a page the user will be sent to after form submission -->

<input type="hidden" name="format" value="table">
<!-- optional field: value="text" is default -->

<input type="hidden" name="Form URL" value="https://ensemble.cms.vt.edu/docs/tips-and-tricks/how_to_forms.html">
<!-- please include the URL of the form; users can add their own hidden fields -->

<div class="form-group">
<label for="name">Full Name:</label>
<input id="name" name="Full Name" class="form-control" type="text">
</div>

<div class="form-group">
<label for="contact">Email:</label>
<input id="contact" name="contact" class="form-control" type="email" autocapitalize="off" autocorrect="off" autocomplete="email">
<!-- required field: collect email from the person filling out the form -->
</div>

<div class="form-group">
<label for="phone">Phone:</label>
<input id="phone" name="phone" class="form-control" type="tel" autocorrect="off" autocomplete="tel">
<!-- collect email from the person filling out the form -->
</div>

<div class="form-group">
<label for="address">Address:</label>
<input id="address" name="Address" class="form-control" type="text" autocorrect="off" autocomplete="address-line1">
</div>

<div class="form-group">
<label for="city">City:</label>
<input id="city" name="City" class="form-control" type="text" autocorrect="off" autocomplete="address-level2">
</div>

<div class="form-group">
<label for="state">State:</label>
<input id="state" name="State" class="form-control" type="text" autocorrect="off" autocomplete="address-level1">
</div>

<div class="form-group">
<label for="zip">Zip:</label>
<input id="zip" name="Zip" class="form-control" type="text" inputmode="numeric" autocorrect="off" autocomplete="postal-code">
</div>

<div class="form-group">
<label for="comments">Question or comment</label>
<textarea id="comments" name="Comments" class="form-control"></textarea>
</div>

<!-- recaptcha2 -->
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-size="compact" data-sitekey="6LfKYUYUAAAAANgUdsBTPnLdP306MeDVpz1SytS1"></div>
<noscript>Completing this form requires javascript.<br><br></noscript>
<!-- /recaptcha2 -->

<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>