Response Emails

With datatables, including generic web forms and calendars, you have the capability of generating response emails automatically every time a user submits information. This allows you to engage your user or provide additional information.

For the purposes of this demonstration, a response email will be created when a user fills out a simple contact form.

Solodev has two built-in datatable fields that are required to create a response email:

  • friendEmail: the field to specify what email address to send the response email
  • friendEmail2: an optional field to specify a secondary email address to send the response email
  • fromEmail: the field to specify what email address should appear as the "From" address in the response email.

Step 1

Open the datatable you want to modify by selecting it from the left hand file tree. Then click on the Modify button.


Step 2

Either upload a new form template or edit the existing template. Click on the "Advanced" tab and select the option under "Form Template".


Step 3

Ensure your form template utilizes the "friendEmail" and "fromEmail" fields. Below is sample form code for a simple "Contact Us" form:

<div class="container" id="contact-main-form">
  <input name="fromEmail" id="fromEmail" type="hidden" value="email@yourcompany.com">
  
  <h2>Tell us about <span>yourself</span></h2>
    
  <div class="row">
    <div class="col-md-6 form-group form-group-contactus">
      <label for="prospect_name">Name</label> <input type="text" name="prospect_name" id="prospect_name" class="form-control required">
    </div>
    <div class="col-md-6 form-group form-group-contactus">
      <label for="friendEmail">Email</label> <input type="text" name="friendEmail" id="friendEmail" class="form-control required">
    </div>
  </div>

  <div class="row">
    <div class="col-md-6 form-group form-group-contactus">
      <label for="company">Company</label> <input type="text" name="company" id="company" class="form-control required">
    </div>
    <div class="col-md-6 form-group form-group-contactus">
      <label for="phone">Phone</label> <input type="text" name="phone" id="phone" class="form-control">
    </div>
  </div>

  <div class="row">
    <div class="col-md-6 form-group form-group-contactus">
      <label for="phone">Fax</label> <input type="text" name="fax" id="fax" class="form-control">
    </div>
    <div class="col-md-6 form-group form-group-contactus">
      <label for="phone">Address</label> <input type="text" name="address" id="address" class="form-control">
    </div>
  </div>

  <div class="second-section">
    <h2>Tell us about <span>your project</span></h2>
    <div class="row">
      <div class="col-md-6 form-group form-group-contactus">
        <label for="budget">Questions</label>
        <select class="form-control contact-us-select" name="project_type" id="project_type">
          <option value="Your Question" selected>What's your question about?</option>
          <option value="broadband">Broadband and Telecom Planning</option>
          <option value="telecom">Telecom Policy, Regulatory and Research</option>
          <option value="infotech">Information Technology</option>
          <option value="sector">Public Sector Technology and Telecom</option>
        </select>
      </div>
      <div class="col-md-6 form-group form-group-contactus">
        <label for="source">Source</label>
        <select name="source" id="source" class="form-control contact-us-select">
          <option value="How did you hear about us?" selected>How did you hear about us?</option>
          <option value="Web search / Google">Web search / Google</option>
          <option value="Social media">Social media</option>
          <option value="Another agency / consultant">Another agency / consultant</option>
          <option value="Conference / meetup">Conference / meetup</option>
          <option value="A link on some other website">A link on some other website</option>
          <option value="Other">Other</option>
        </select>
      </div><!--col-md-6-->
    </div><!--row-->

    <div class="contact-us-textarea">
      <div class="row">
        <div class="col-md-12">
          <label for="details">Message</label>
          <textarea name="message" id="message" class="form-control" cols="10"></textarea>
        </div>
        <div class="col-md-12">
          <input type="submit" class="btn btn-warning cnl-blue-btn contact-us-btn" style="width:100%" value="Send">
        </div>
      </div>
    </div>
  </div>
</div>

Notice the "fromEmail" field is given the type "hidden" so that it is not displayed. Its value can be set to whatever email address you wish to specify as sending the email. Preferably, this email address is associated with the website's domain.

Also notice the "friendEmail" field. For consistency, the "name", "id" and label "for" attributes should all reference the same "friendEmail".


Step 4

Update your table schema to include the new friendEmail field. In the schema below, the more typical "email" name was changed to "friendEmail".


Step 5

Upload the custom email you wish to send. Create this email using regular HTML and limited styling. To upload this file, click on the "Email Options" tab and then click on "Upload Custom Email".


Step 6

Below is sample HTML to be sent upon form submission.

<h2>Thank You</h2>
<p>Thank you for your contact form submission. We'll contact you shortly.</p>
<p>We appreciate your submission and interest in our services.</p>

Step 7

Change the Notification Type to "Submission + Custom Email" and click on Submit to save your changes.


Final Result

With your form template, datatable schema, and custom email HTML all updated/uploaded, your form is now ready to generate automatic emails upon submission. Below is what a user will receive after submitting a form using the above code samples:

When testing, you cannot use the same email address specified under the "Tickler Information" in the backend. This helps ensures emails sent from Solodev CMS do not get marked as spam.

2 Comments

  • 0
    Avatar
    Shelley Northrup

    I got this to work, but two suggestions. I would break out the part about "Note you must also change the Notification Type to "Submission + Custom Email"." into a step. I missed it at first. Also, When you do a test, you can not use the same email address that you have in the backend to receive the emails.

  • 0
    Avatar
    Scott Madara

    @Shelley

    Great points! We've modified the article to incorporate your notes. Thanks for the feedback.

Please sign in to leave a comment.
Have more questions? Submit a request