我需要知道我的if语句有什么问题:
//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目前,该邮件已发送,但同一封电子邮件多次到达我的第一个电子邮件地址,但地址不正确。