Sending a pre-defined message stored in database
-
Hello guys,
I am having trouble with getting wordpress to send a pre-defined message, stored in database. I would like to use wysija newsletter plugin to be able to modify the email template and keep inline css without having to bother about it.
Here is part of my code, retrieved by a cron job:
global $wpdb;
$results = $wpdb->get_results( $wpdb->prepare( “SELECT body FROM wysija_email WHERE email_id === 7”) );
$message = $results;
// $message = ‘This is a test message.’;
$email_result = wp_mail( $to, $subject, $message, $headers );When I remove the slashes, the testmessage sends successfully, but I can not manage to send the message stored in the database. I also tried changing body to created_at (which is just a simple number) to see whether the field was too large or inconsistent, but it doesn’t look like it is the case. What am I doing wrong?
Thanks in advance.
The topic ‘Sending a pre-defined message stored in database’ is closed to new replies.