' . __('Test', 'post_notification') . '';
?>
' . __('Email', 'post_notification') . '';
$t_emails = $wpdb->prefix . 'post_notification_emails';
$emails = $wpdb->get_results(
" SELECT e.email_addr, e.id, e.act_code" .
" FROM $t_emails e".
" WHERE e.email_addr = '" . $_POST['email'] . "'"); //We need this. Otherwise we can't be sure whether we already have sent mail.
if(!$emails){
echo ' '. __('Error:', 'post_notification') . ' ' .__('Email has to be in the database.', 'post_notification') . '
';
} else {
$email = $emails[0];
if(file_exists(POST_NOTIFICATION_PATH . 'userfunctions.php'))
include_once(POST_NOTIFICATION_PATH . 'userfunctions.php');
$GLOBALS['wp_query']->init_query_flags();
$maildata = post_notification_create_email($_POST['pid'] , $_POST['template']);
$send = ($_POST['nosend'] == 'true') ? false : true;
$maildata = post_notification_sendmail($maildata, $email->email_addr,'', $send); //returns the modified body.
if($maildata['sent']==false){
global $phpmailer;
echo '
The mail has not been sent!
';
echo 'PHP-Mailer - Dump:
';
var_dump($phpmailer);
echo '
';
}
echo 'Header:
';
echo $maildata['header'];
echo '
Subject:' . $maildata['subject'] . '
';
echo 'Body:
';
echo htmlspecialchars($maildata['body']);
echo '
';
}
}
}
?>