Tagged: 

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

    #189998

    Hey jrevillini!

    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?

    Regards,
    Peter

    #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.

    #190188

    Can you tell me where you wp_mail() and i’ll check the values right before send?

    #190213

    OK found it.

    File: /wp-content/themes/enfold/framework/php/class-form-generator.php
    Line: 665

    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.

    #190508

    Hey!

    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.

    Regards,
    Peter

    #190734

    very cool. yes, i misunderstood the label. I thought that if i entered nothing (hey, I’m lazy), then it would use the default email of the system. i think adding a check that it’s filled out is a great solution.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘contact form does not send to default email (or i am misunderstanding something)’ is closed to new replies.