[[!FormIt? &hooks=`email,redirect` &emailTpl=`wholesaleEmail` &emailTo=`[email protected]` &emailFromName=`Warrens Bakery` &emailSubject=`xxxxx` &redirectTo=`57` &validate=`name:required,telephone:required,email:email:required,text:required:stripTags,workemail:blank` ]] [[!+fi.validation_error_message:notempty=` <div class="errors"> <strong>Some errors were detected in your form:</strong> [[!+fi.error_message]][[!+fi.validation_error_message]] </div>`]] <form method="post" action="[[~[[*id]]]]#" class="contact-form"> <fieldset><legend>Email Us</legend> <ul> <li> <label for="name">Name:*</label> <input type="text" name="name" class="text cleardefault" placeholder="Name" value="[[!+fi.name]]"> [[!+fi.error.name]] </li> <li> <label for="telephone">Tel:*</label> <input type="text" name="telephone" class="text cleardefault" placeholder="Telephone number" value="[[!+fi.telephone]]"> [[!+fi.error.telephone]] </li> <li> <label for="email">Email:*</label> <input type="text" name="email" class="text cleardefault" placeholder="Email address" value="[[!+fi.email]]"> [[!+fi.error.email]] </li> <li> <label for="text">Message: </label> <textarea name="text" placeholder="Products of interest">[[!+fi.text]]</textarea> [[!+fi.error.text]] </li> <input type="hidden" name="workemail" value="" /> <li><input type="submit" name="submit" class="button1" value="Send Email"></li> </ul> </fieldset> </form>
<p>This is a response sent by [+name+] using the feedback form on the website. The details of the message follow below:</p> <table> <tr valign="top"><td>Name:</td><td>[[+name]]</td></tr> <tr valign="top"><td>Telephone number:</td><td>[[+telephone_number]]</td></tr> <tr valign="top"><td>Email address:</td><td>[[+email]]</td></tr> <tr valign="top"><td>Products of interest:</td><td>[[+text]]</td></tr> </table> <p>You can use this link to reply: <a href="mailto:[[+email]]?subject=RE:Wholesale">[[+email]]</a></p>
if (is_string($hooks)) $hooks = explode(',',$hooks);
if (is_string($hooks)) { $hooks = trim($hooks, '`'); $hooks = explode(',',$hooks); }
[2014-07-03 18:20:00] (ERROR @ /new/revo/index.php) [FormIt] An error occurred while trying to send the email. Message body empty
if (is_string($hooks)) { $hooks = trim($hooks, '`'); $hooks = explode(',',$hooks); }
For anyone landing on this tread having a similar issue. I also did get the "An error occurred while trying to send the email. Message body empty" error. In my case I had set debug=`1` in the FormIt call. When I disabled debug mode, everything was working again (and the body wasn't empty at all...)