<p>I figured it out by duplicating the field...</p>

<pre><code>&lt;input id="fromName" type="text" name="fromName" 
value="{% if message is defined %}{{ message.fromName }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}
&lt;input type="hidden" id="fullName" name="message[Full Name]" class="fullName"&gt;
</code></pre>

<p>Then duplicating the single entry to the hidden with some Javascript...</p>

<pre><code>    $('#fromName').bind('keypress keyup blur', function() {
      $('#fullName').val($(this).val());
    });
</code></pre>

<p>It parses through to the email message as:</p>

<p>Full Name: First Last</p>

CC BY-SA 3.0
2017-10-16T06:08:13.573Z
2017-10-16T06:08:13.573Z
Jeff Fulton
<p>This is a follow-up to an earlier question from 2014: <a href="https://craftcms.stackexchange.com/questions/1400/pt-contact-form-plugin-how-can-i-copy-name-and-email-address-in-the-body-o">P&amp;T Contact Form plugin: How can I copy “name” and “email address” in the body of the mail?</a> ... it seems that Craft (and the plugin) has gone through significant updates since that question was answered.</p>

<p>How would I include <code>fromName</code> and <code>fromEmail</code> into the body of the message?</p>

<p>I read about events in the documentation, but it doesn't say where they go. Do I put those into the craft>config>contactform.php file? How would I setup an event to handle that inclusion?</p>

CC BY-SA 3.0
2017-10-15T14:45:41.003Z
What context do you wan to include it? Do you want to say "Message from Jeff his email is "jeff@email.com" and then show the contents of the body?

Or do you want to inject the to/email within the body of the message?
For example, if Jeff had a message of "Hey i like your site [Jeff] [jeff@email.com] have a great day". 

Who would get this email? The admin or the user as a confirmation email?
Damon
CC BY-SA 3.0
2017-10-15T16:16:48.490Z
I’m trying to use it as a basic signup form. I edited the config file to allow for recipients to be controlled from the template as an entry... I would be okay if just fromName and fromEmail passed through onto the message body
Jeff Fulton
<plugin-contactform>
Contact Form: Name and Email in Message Body
# Contact Form: Name and Email in Message Body

(Asked by: username_0 on 2017-10-15)

This is a follow-up to an earlier question from 2014: [P&T Contact Form plugin: How can I copy “name” and “email address” in the body of the mail?](https://craftcms.stackexchange.com/questions/1400/pt-contact-form-plugin-how-can-i-copy-name-and-email-address-in-the-body-o) ... it seems that Craft (and the plugin) has gone through significant updates since that question was answered.

How would I include `fromName` and `fromEmail` into the body of the message?

I read about events in the documentation, but it doesn't say where they go. Do I put those into the craft>config>contactform.php file? How would I setup an event to handle that inclusion?

**Tags:** plugin-contactform

> **Comments:**
> **username_1**: What context do you wan to include it? Do you want to say "Message from Jeff his email is "jeff@email.com" and then show the contents of the body?  Or do you want to inject the to/email within the body of the message? For example, if Jeff had a message of "Hey i like your site [Jeff] [jeff@email.com] have a great day".   Who would get this email? The admin or the user as a confirmation email?  
> **username_0**: I’m trying to use it as a basic signup form. I edited the config file to allow for recipients to be controlled from the template as an entry... I would be okay if just fromName and fromEmail passed through onto the message body  

---

## 1 answers

### Answer by username_0 on 2017-10-16. Score: 2

I figured it out by duplicating the field...

{{ message is defined and message ? errorList(message.getErrors('fromName')) }}


Then duplicating the single entry to the hidden with some Javascript...
    $('#fromName').bind('keypress keyup blur', function() {
      $('#fullName').val($(this).val());
    });

It parses through to the email message as:
Full Name: First Last


---

