We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Email: How do I insert the persons name & email into the body of an email?

How Do I?

Russ K.'s avatar
Russ K.
114 posts
9 years ago
Russ K.'s avatar Russ K.

For convenience sake, I’d like to add the “name” and “from” values (of people who are NOT members) from my contact form into the body of the sent email. I know they show up in the address line, but I’d like to include them in the body as well.

This seems like it would be a simple thing, so I feel a little silly asking.

Russ

       
Rob Allen's avatar
Rob Allen
2,950 posts
9 years ago
Rob Allen's avatar Rob Allen

What email form are you using, EE’s native form or a 3rd party addon such as Freeform?

       
Russ K.'s avatar
Russ K.
114 posts
9 years ago
Russ K.'s avatar Russ K.

EE’s Native Form.

Thanks. Russ

       
Rob Allen's avatar
Rob Allen
2,950 posts
9 years ago
Rob Allen's avatar Rob Allen

You can get the persons name into the email body by changing the input name to message[] something like this:

<label for="name">Name</label>
<input type="hidden" name="message[]" value="—Name—">
<input type="text" id="name" name="message[]" value="">

There’s no easy way to get the email address into the email body, but you could use some Javascript to copy the value into a hidden field and pass it through that way.

       
Russ K.'s avatar
Russ K.
114 posts
9 years ago
Russ K.'s avatar Russ K.

OK. Thanks. It’s kind of what I thought, was just hoping there was an easier way. And passing the name into the message array doesn’t prepend the name in the email From line.

R

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.