Thread Starter
MooK
(@kubelyan)
First problem has been gone.
But I am still having problem with second.
When I receive emails sent from contact form, in sender’s name it shows as “me”, instead of the name, entered into name box in the contact form. That’s why most of my emails goes directly to spam. What should I change?
Many thanks!
Hi,
This isn’t the reason why it goes to spam. We use “me” as the sender’s name to make it easy for the admin to understand that it’s their contact form. Because anyone can use any fake emails/name there. 🙂
Regards,
Hardeep
Thread Starter
MooK
(@kubelyan)
Hi, thanks.
But is there any way to use sender’s name from contact form?
Hi,
In the front-page.php file, you can change the sender’s name by editing this line of the code:
$headers = 'From: '.$name.' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
Regards,
Hardeep
I am having the same problem with the contact form. After I submit the contact form the site jumps all the way up to the top and you cannot read that it was successfully submitted, do you scroll all the way back down.
Thread Starter
MooK
(@kubelyan)
thanks Hardeep.
I found the code, and tried to change, but looks like I am doing something wrong.
which part of it I have to change in order to get an email with the name entered into [your name] field from contact form?
thanks.
Hi,
It is exactly what you should use in order to do accomplish what you’re looking for. It’s weird that it’s not happening. Try again and send me a screenshot of the email you receive. :/
Regards,
Hardeep
Thread Starter
MooK
(@kubelyan)
this is what my code looks like right now:
/* send the email */
if(!isset($hasError)):
$zerif_contactus_email = get_theme_mod(‘zerif_contactus_email’);
if( empty($zerif_contactus_email) ):
$emailTo = get_theme_mod(‘zerif_email’);
else:
$emailTo = $zerif_contactus_email;
endif;
if(isset($emailTo) && $emailTo != “”):
if( empty($subject) ):
$subject = ‘From ‘.$name;
endif;
$body = “Name: $name \n\nEmail: $email \n\n Subject: $subject \n\n Message: $message”;
$headers = ‘From: ‘.$name.’ <‘.$emailTo.’>’ . “\r\n” . ‘Reply-To: ‘ . $email;
wp_mail($emailTo, $subject, $body, $headers);
$emailSent = true;
else:
$emailSent = false;
endif;
endif;
endif;
$zerif_bigtitle_show = get_theme_mod(‘zerif_bigtitle_show’);
if( isset($zerif_bigtitle_show) && $zerif_bigtitle_show != 1 ):
include get_template_directory() . “/sections/big_title.php”;
endif;
?>
Thread Starter
MooK
(@kubelyan)
I wish I could send you a screenshot of the email.
But there is no option to attach an image to the post…
Hi,
You can just upload the screenshot to a website and share the link here. 🙂
Regards,
Hardeep
Thread Starter
MooK
(@kubelyan)
thanks for tip.
but instead I just copied the code here:
it its not enough to determine the problem?
if(!isset($hasError)):
$zerif_contactus_email = get_theme_mod(‘zerif_contactus_email’);
if( empty($zerif_contactus_email) ):
$emailTo = get_theme_mod(‘zerif_email’);
else:
$emailTo = $zerif_contactus_email;
endif;
if(isset($emailTo) && $emailTo != “”):
if( empty($subject) ):
$subject = ‘From ‘.$name;
endif;
$body = “Name: $name \n\nEmail: $email \n\n Subject: $subject \n\n Message: $message”;
$headers = ‘From: ‘.$name.’ <‘.$emailTo.’>’ . “\r\n” . ‘Reply-To: ‘ . $email;
wp_mail($emailTo, $subject, $body, $headers);
$emailSent = true;
else:
$emailSent = false;
endif;
endif;
endif;
$zerif_bigtitle_show = get_theme_mod(‘zerif_bigtitle_show’);
if( isset($zerif_bigtitle_show) && $zerif_bigtitle_show != 1 ):
include get_template_directory() . “/sections/big_title.php”;
endif;
?>
Hi,
No it won’t be. Anyways, I’ll try to produce this issue on my site and will let you know. 🙂
Regards,
Hardeep
Thread Starter
MooK
(@kubelyan)
Thanks you.
Looking forward
How did you fix Problem number one page going to top after sending form?
Thread Starter
MooK
(@kubelyan)
I didn’t fix it.
just realized it’s doing only on Firefox.
But is this point will wait til the authors of the theme will find the solution…