I’m trying to check if my email field has a value and if it does, send the email. My code is below.
I don’t get any errors but I don’t get any email either, what am I missing?
<?php
// Email the form
function send_email( $pov_id ) {
if (get_field('email', $pov_id)) {
$post_url = get_permalink( $post_id );
$subject = "POV Travel Calculator Summary";
/* Let's prepare the message for the e-mail */
$message = "Hello!
Total Travel Entitlement: $".$totalTvl."
<a href='. $post_url. '>Click here to view your travel entitlement summary</a>\n\n
";
//sends email
wp_mail($email, $subject, $message );
}
}
?>
Disregard,
I removed function send_email( $pov_id ) {}
and it works fine.
This is the value in walking away from the code and coming back later.