Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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,
    Paul

    #1027274

    Hi 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,
    Paul

    #1028335

    Hi,

    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,
    Ismael

    #1028513

    Hey, 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

    #1029078

    Hi,

    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,
    Ismael

    #1029274

    Hi 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,
    Paul

    #1029808

    Hi!

    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,
    Ismael

    #1030865

    Thank 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 !!

    #1031545

    Hi,

    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,
    Ismael

    #1234164

    As 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 Limited

    Kindly assist.

    #1234708

    Hi,

    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,
    Ismael

    #1234782

    Thanks 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 Limited

    #1235567

    Hi,

    Thank you for the clarification.

    Those fields will not be included in the autoresponse if that’s what you’re worried about. Did you fill out the contact form’s Content > Backend > Autoresponder fields?

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.