If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
Tagged: CONTACT FORM
November 16, 2013 at 6:13 pm #189626
If the email recipient field of the contact form dialog should be able to be blank in order to send to the default email mentioned in the help text, that feature is broken in the latest enfold. Leaving that field blank yields no sent message after submitting the form.
I notice that the help text reads:
Enter the Email address where mails should be delivered to. (Default: (Email address hidden if logged out) ‘)
Notice the little apostrophe after the email address? Could it be that the enfold theme is getting a value from the DB and adding an extra character?
If I type my email address into the field to set it explicitly, the issue goes away and emails get sent, so it’s minor.November 18, 2013 at 10:07 am #189998
Thank you for the hint – we”ll fix the typo in the next version. The label of the email field does not affect the default value though – we use the get_option(‘admin_email’) function to fetch the default email from the database (see code in /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/contact.php ). I couldn’t reproduce the issue on my test server but maybe you entered a wrong admin email address on the settings page?
PeterNovember 18, 2013 at 5:20 pm #190165
They look identical to me and i can reproduce the issue. Is there an easy way to debug? I’ll do the debugging and find out if it’s a plugin conflict.November 18, 2013 at 5:44 pm #190188
Can you tell me where you wp_mail() and i’ll check the values right before send?November 18, 2013 at 6:21 pm #190213
OK found it.
That’s where you use wp_mail to send mail from the form using ajax.
If I create a contact form and enter nothing in the place for the email recipient, the value in $send_to_email is empty.
I used this line to debug, directly before the wp_mail call:
file_put_contents( '/xxxx/xxxx/tmp/ajaxmail.log', @file_get_contents( '/xxxx/xxxx/tmp/ajaxmail.log' ) . "$send_to_mail | $subject | $message | $header \n\n" );
$send_to_mail was blank.
So I also output values for $this->form_params[‘myemail’], $new_post[‘myemail’], $to, and $copy – all were blanks.
And you’re saying that on your test environment, you can leave the recipient blank when configureing the contact form and it picks up the default email address and uses it? Maybe somebody fixed something along the way. But I think this is reproducible using the stable release on themeforest.November 19, 2013 at 10:59 am #190508
I think I misunderstood you yesterday – I thought you mean that the default value (mail address in the input) is wrong because the label shows a ‘ after the mail address. But it seems like you referred to an “empty” input field (= no mail address in the option field). This normally shouldn’t happen because we set the default mail address as standard value. However we’ll include a check in the next version to avoid that an empty email address value breaks the form.
PeterNovember 19, 2013 at 10:31 pm #190734
The topic ‘contact form does not send to default email (or i am misunderstanding something)’ is closed to new replies.