Subject not appearing in email from Formlt

I am trying to get the subject line in my email?
This is my email tpl:

`<br />[[+name]] ([[+email]]) Wrote: <br />
[[+subject]]

[[+text]]`

And here is my template:

 [[!FormIt?
   &hooks=`spam,email`
   &emailTpl=`MyEmailChunk`
   &emailTo=`admin@domain`
   &emailFrom=`admin@domain`
   &validate=`workmail:blank,
      name:required,
      email:email:required,
      subject:required,
      text:required:stripTags`
      &successMessage=`<h3>Success! Your enquiry has been sent.</h3>`
]]
<h2>Contact Form</h2>

[[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]

<form action="[[~[[*id]]]]" method="post" class="form">
    <input type="hidden" name="workmail" value="" />

    <label for="name">
        Name:
        <span class="error">[[!+fi.error.name]]</span>
    </label>
    <input type="text" name="name" id="name" value="[[!+fi.name]]" />

    <label for="email">
        Email:
        <span class="error">[[!+fi.error.email]]</span>
    </label>
    <input type="text" name="email" id="email" value="[[!+fi.email]]" />

    <label for="subject">
        Subject:
        <span class="error">[[!+fi.error.subject]]</span>
    </label>
    <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" />

    <label for="text">
        Message:
        <span class="error">[[!+fi.error.text]]</span>
    </label>
    <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
    [[!+fi.successMessage]]
    <div class="form-buttons">
        <input type="submit" value="Send Contact Inquiry" />
    </div>
</form>

And this is what I get in my email:

<html><body><p>

<br>dale (myemail@gmail.com) Wrote: <br>
test template<!--I think this is the subject-->

Has it worked</p></body></html>

Using a Subject Field as the Email Subject Line

1 Like

How did I miss that, thanks.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.