-
AuthorPosts
-
October 28, 2018 at 1:31 pm #1027241
Hi Support,
First challenge:
I’d like to remove the form content fields from the Auto Responder email.
Currently all the form content is added below the email text under the heading “Your Message:”
In the forum I found a way to remove the text “Your Message:”, but not the field output contents.Second challenge:
I have different languages on the site and I’d like to change the subject text for the respective languages.
I’m using this code for the English version, but how do I target/specify the other forms as per the language.add_filter( ‘avia_contact_form_args’, ‘enfold_customization_autoresponsder’, 10, 1);
function enfold_customization_autoresponsder( $form_args ) {
$form_args[‘autoresponder_subject’] = ‘Thank you for your inquiry!’;
return $form_args;
}Thanks in advance for any pointers.
Best regards,
PaulOctober 28, 2018 at 5:44 pm #1027274Hi Support,
The second challenge I’ve solved by adding a second line to the code – First EN, then DE and soon I’ll add ES.
// Changes the Subject Line of the Enfold Contact Form’s autoresponse. EN, DE, ES
add_filter( ‘avia_contact_form_args’, ‘enfold_customization_autoresponsder’, 10, 1);
function enfold_customization_autoresponsder( $form_args ) {
$form_args[‘autoresponder_subject’] = ‘Thank you for your inquiry!’;
$form_args[‘autoresponder_subject’] = ‘Vielen Dank für Ihre Anfrage!’;
return $form_args;
}Best,
PaulOctober 31, 2018 at 2:42 am #1028335Hi,
Thank you for using Enfold.
Are you using WPML? You may need to use a conditional function to change the autoresponse message for each language.
switch (ICL_LANGUAGE_CODE) { case 'en': $form_args['autoresponder_subject'] = 'Thank you for your inquiry!'; break; case 'es': $form_args['autoresponder_subject'] = '¡Gracias por su consulta!'; break; case 'de': $form_args['autoresponder_subject'] = 'Vielen Dank für Ihre Anfrage!'; break; default: $form_args['autoresponder_subject'] = 'Thanks!'; } return $form_args;
Best regards,
IsmaelOctober 31, 2018 at 4:08 pm #1028513Hey, thanks for the support Ismael. I’ll perhaps give that a try, although the current workaround for Challenge two is also working, as per the update above. The ‘first challenge’ I still haven’t solved, ie. hiding the Your Message content, any tips on how to do that? Thanks in advance. -Paul
November 2, 2018 at 9:00 am #1029078Hi,
Can you give us a screenshot of that issue? Are you referring to the email message? This might help:
// https://kriesi.at/support/topic/text-translation-in-confirmation-email/#post-1012340
Replace the “Your message” text with nothing if you want to remove the default text info.
Best regards,
IsmaelNovember 2, 2018 at 6:45 pm #1029274Hi Ismael,
Sure, here’s a link to a screenshot of what appears underneath the email text. It is a copy of what people complete in the form. This is what I am trying to remove, ie. their form response content. The link above I had found but it only hides the “Title” not the form response.
https://drive.google.com/file/d/1UYZzzoMAr84iq1l9xGAZEEiqthQ9ItxV/view?usp=sharing
Hope that helps explain it better.
Regards,
PaulNovember 5, 2018 at 9:36 am #1029808Hi!
Thanks for the info. This filter should remove that text:
function avf_form_autorespondermessage_mod($message) { $message = str_replace('Your Message:', '', $message); return $message; } add_filter('avf_form_autorespondermessage', 'avf_form_autorespondermessage_mod', 10, 1);
You can also replace it with another text by adjusting the second value of the “str_replace” function.
Best regards,
IsmaelNovember 7, 2018 at 2:23 pm #1030865Thank you for the ICL code. Applied it today and it works great.
The ‘hide’ message code above also works, if one only wants to hide/replace the text ‘Your Message’, but what I wanted to do was remove ALL the forms content from the email, ie. the output of the form completion. Name, Tel no. etc… sorry if I have not made this clear… but have tried !!
November 9, 2018 at 6:14 am #1031545Hi,
Do you want to remove the input identifiers such as “First name:”, “Last name:” etc? You can add more str_replace function like this:
$message = str_replace('First name:', '', $message); $message = str_replace('Last name:', '', $message); // more str_replace code here
Or create an array of texts that you want to remove:
function avf_form_autorespondermessage_mod($message) { $excludes = array( "Your Message", "First name: ", "Last name:" ); foreach( $excludes as $remove ) { $message = str_replace( $remove, '', $message ); } return $message; } add_filter('avf_form_autorespondermessage', 'avf_form_autorespondermessage_mod', 10, 1);
Add the texts that you don’t want inside the $excludes array.
Best regards,
IsmaelJuly 30, 2020 at 2:37 pm #1234164As much as I apply these I can only get rid of the titles: First name, E-mail address but i need to remove the below details too:
First Name: azim
Your E-mail Address: (Email address hidden if logged out)
Your Mobile: 0204400456
Your Company: ACEteK LimitedKindly assist.
August 3, 2020 at 6:12 am #1234708Hi,
Thank you for the inquiry.
Why would you like to remove those info? Those are details from the contact form fields, so if you don’t want to include them in the sent messages, just remove the designated form fields in the contact form.
Best regards,
IsmaelAugust 3, 2020 at 11:23 am #1234782Thanks Ismael. Maybe I didn’t explain it correctly.
The details below are part of the response sent to the client. I as a user get the details but I don’t want the customer to see those details on the response that he receives.First Name: azim
Your E-mail Address: (Email address hidden if logged out)
Your Mobile: 0204400456
Your Company: ACEteK LimitedAugust 6, 2020 at 3:27 am #1235567 -
AuthorPosts
- You must be logged in to reply to this topic.