I need to know what is wrong with my if statement here:
//EMAIL ADMIN BASED ON PROBLEM_TYPE
function new_post_creation_email() {
global $post;
$postid = $post->ID;
$problem_type = get_post_meta($postid, 'problem_type', true);
$description = the_content();
if ($problem_type = 'phones') {
$to = '1st email here';
}
elseif ($problem_type = 'computers') {
$to = '2nd email here';
}
else {
$to = '3rd email here';
}
$subject = "New Ticket in " . get_post_meta($postid, 'problem_type', true);
$message = "A new ticket has been added. Please login to view and print.";
wp_mail($to, $subject, $message);
}
Emails are correct in actual code Currently, the message sends but the same email arrives multiple times in my 1st email address, not the correct one.
