Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #385308

    Hi

    I have just uploaded my first ENFOLD based site to a hosted server and messages from the contact form are not sent. I’m using the native implementation. ENFOLD 3.0.4, WP 4.1.
    I do receive a success message but the messages never arrive to destination.

    Had a long conversation with the hosting company. They ran an analysis of the site which led to the conclusion that php mail() is not even invoked when I submit a form. My guess was that it has to do with some anti-spam policy blocking the messages but it seems I’m not even at this stage. No attempt is actually made to send the message at all.
    Furthermore, php mail is properly configured on the site as a small test script manages to send php mail which arrives to destination.
    I do not currently have access to the mail logs (as this is a shared hosting) but the hosting support ran a check for me and told me no calls from my contact form were made to the system to send mail.

    My questions are:

    1) In what scenarios can I receive a success status on my form even if message is not sent?
    2) Are there logs or any other debug information where I can see what’s going on in the sending process?
    3) Extending point 2, Where can I see/set the full set of parameters used when sending the mail from the contact form?

    Any hint that might be relevant is greatly appreciated.

    Thanks,
    Sharon

    • This topic was modified 9 years, 9 months ago by Elliott.
    #385403

    I continued investigating this further and found out something surprising.
    When I shorten the email subject (the default subject attached to the contact form) from six to two words – messages are sent and arrive perfectly OK to destination.
    Is there a limit to the length of the subject?

    1) I would still like to know how to see debug information from the sending process so I can overcome other issues in the future without this trial and error testing.

    2) How can I set the reply-to header in the messages to be the email entered by the user submitting the form and not my system mail (from which the actual email is sent)?

    Thanks,
    Sharon

    #387121

    Hi!

    Have you tried using the Contact Form 7 plugin (https://wordpress.org/plugins/contact-form-7/)? If it still doesn’t work with the plugin then is has something to do with the email configuration. Please contact your host.
    Can you show us a link with the contact form you are using?
    See this to activate debug mode: http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/. You can send us the shortcodes of your contact form after activating debug mode to be able to reproduce the issue.

    The mail code can be found in wp-content\themes\enfold\framework\php\class-form-generator.php and Enfold is using following code:

    $header .= 'From: '. $from . " <".$from."> \r\n";
    				wp_mail($to, $subject, $message, $header); 
    

    Regards,
    Andy

    • This reply was modified 9 years, 9 months ago by Andy.
    #387126

    Hi!

    Not sure what could be going on there sharonAIR. Can you send us a WordPress login and a link to the page so we can take a look at your settings?

    You can do this to change the from header, https://kriesi.at/support/topic/reply-adress-how-can-i-change-it-to-another/#post-270619.

    Cheers!
    Elliott

    #387579

    Thank you both for the input. I will turn on debug and look at the shortcodes.
    As to the ‘from’ email, I did see what you suggest and have actually implemented it right from the start. I’m already using ‘avia_change_from’.
    What I’m now looking for is a way to set the reply-to field in the email header. The flow I’m looking to accomplish is as follow:

    1) user submits a message through the contact form on site
    2) admin receives and email with the message submitted and selects to reply to it
    3) the reply is sent not the ‘from’ address (which is an email under the site domain) but rather to the user who initially submitted the message on site. This email is one of the fields the user filled in the form.

    In past sites I accomplished this flow with contact form 7 setting an additional header ‘Reply-to’ to be [user-email].
    Is there a way to add email headers to the native contact form implementation? most preferably with a filter/action and not by modifying the actual send code. (I’m working with a child theme)

    Best,
    Sharon

    • This reply was modified 9 years, 9 months ago by sharonAlR.
    #388052

    Hi!

    We can probably use the avf_form_mail_header filter but before we get into that try adding this beneath line 711 in /enfold/framework/php/class-form-generator.php.

    $header .= 'Reply-To: ' . $from . '\r\n';
    

    To see if it works or not.

    Cheers!
    Elliott

    #389293

    Hi Elliott

    What you suggested works perfectly. What would be the cleanest way to do this from within my child theme’s functions.php without touching the ENFOLD code?
    I need the actual email address added to be the one the user submitted in one of the form fields.

    Thanks,
    Sharon

    #389784

    Hi!

    I didn’t test this but you can try adding it to the bottom of your child theme functions.php file.

    add_filter( 'avf_form_from', 'enfold_customization_contact_form_etc', 10, 3 );
    function enfold_customization_contact_form_etc( $from, $p1, $p2 ) {
    	global $enfold_custom_from_header;
    	$enfold_custom_from_header = $from;
    }
    add_filter( 'avf_form_mail_header', 'enfold_customization_contact_form_etc2', 10, 3 );
    function enfold_customization_contact_form_etc2( $header, $p1, $p2 ) {
    	global $enfold_custom_from_header;
    	$header .= 'Reply-To: ' . $enfold_custom_from_header . '\r\n';
    	return $header;
    }

    Best regards,
    Elliott

    • This reply was modified 9 years, 9 months ago by Elliott.
    #394140

    I just used what Elliott suggested and it worked perfectly for me.

    Thanks Elliott, you are a life saver!!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘contact form – change reply to text’ is closed to new replies.