form data in confirmation email
-
Hello,
is there meanwhile a possibility to use form data (e.g. first name, last name) in the happyforms confirmation email?
Greetings Natalie
-
Hey there, @viewsmarketing π
Over in the Email tab, under “Email respondent a copy of their submission”, be sure to enable “Include submitted values”. Doing this will include all the respondent’s answers in the confirmation email.
We don’t yet have a way to include specific answers in email messages (e.g. “Thank you, @first_name”). That’s on our to-do list for later this year.
By the way, this forum is for our free users. As a paying customer, please email ask[at]happyforms[dot]io β we can help you out much faster there.
-
This reply was modified 4 years ago by
Anonymous User 18525946.
-
This reply was modified 4 years ago by
Anonymous User 18525946.
Hi Scott,
thank you very much for your reply. I obviously expressed myself inaccurately. I would like to enter in “Receive a copy of each submission via email” in the “Displayed email sender name” field, the last name and first name from the fields that the sender has populated with their information.
Is this possible?
Best regards
NatalieGot it, @viewsmarketing!
As mentioned by Scott, this isn’t possible out of the box yet, sorry! If you’re okay copy-pasting a bit of custom code though, it’s definitely doable with a simple snippet, and we’d be glad to provide a ready made one.
Let us know!
Just checking in here, @viewsmarketing. Would you like to try the code snippet?
We can walk you through the steps. It’s less scary than it sounds π
Just let us know!
-
This reply was modified 4 years ago by
Anonymous User 18525946.
Hi,
yes, I would love to try the code snippet!
Best regards
NatalieHey @viewsmarketing π
Sorry it took so long to come back to you. Here’s the snippet β you can either copy-paste it at the bottom of your child theme functions.php file, or use a plugin like Code Snippets:
add_filter( 'happyforms_email_alert', function( $email_message ) { $first_name_label = 'First name'; $last_name_label = 'Last name'; $from_name = $email_message->get_from_name(); $form_id = $email_message->message['form_id']; $form = happyforms_get_form_controller()->get( $form_id ); $parts = wp_list_pluck( $form['parts'], 'id', 'label' ); $message_parts = $email_message->message['parts']; if ( isset( $parts[$first_name_label] ) ) { $from_name = $message_parts[$parts[$first_name_label]]; } if ( isset( $parts[$last_name_label] ) ) { $from_name .= ' ' . $message_parts[$parts[$last_name_label]]; } $email_message->set_from_name( $from_name ); return $email_message; } );Just make sure to tweak lines 2 and 3, so that they match your “first name” and “last name” field labels.
Let us know how that goes!
How did that go, @viewsmarketing? Did that do the trick?
I’ll close this thread. If you still need a hand, please reach out in a new topic.
-
This reply was modified 4 years ago by
The topic ‘form data in confirmation email’ is closed to new replies.