From dccbf9fcddf456fb2cf0a5ffa1bfb6def2a8001a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 29 Nov 2022 17:34:22 +1300 Subject: [PATCH] Fix query to use standard CRM_Core_DAO::executeQuery --- CRM/Mailing/Event/BAO/MailingEventReply.php | 25 ++++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/CRM/Mailing/Event/BAO/MailingEventReply.php b/CRM/Mailing/Event/BAO/MailingEventReply.php index 8d3c5da92467..9d079d805eca 100644 --- a/CRM/Mailing/Event/BAO/MailingEventReply.php +++ b/CRM/Mailing/Event/BAO/MailingEventReply.php @@ -195,22 +195,15 @@ public static function send($queue_id, &$mailing, &$bodyTxt, $replyto, &$bodyHTM * Optional reply-to from the reply. */ private static function autoRespond(&$mailing, $queue_id, $replyto) { - $config = CRM_Core_Config::singleton(); - - $contacts = CRM_Contact_DAO_Contact::getTableName(); - $email = CRM_Core_DAO_Email::getTableName(); - $queue = CRM_Mailing_Event_DAO_MailingEventQueue::getTableName(); - - $eq = new CRM_Core_DAO(); - $eq->query( - "SELECT $contacts.preferred_mail_format as format, - $email.email as email, - $queue.job_id as job_id, - $queue.hash as hash - FROM $contacts - INNER JOIN $queue ON $queue.contact_id = $contacts.id - INNER JOIN $email ON $queue.email_id = $email.id - WHERE $queue.id = " . CRM_Utils_Type::escape($queue_id, 'Integer') + $eq = CRM_Core_DAO::executeQuery( + 'SELECT contact.preferred_mail_format as format, + email.email as email, + queue.job_id as job_id, + queue.hash as hash + FROM civicrm_contact contact + INNER JOIN civicrm_mailing_event_queue queue ON queue.contact_id = contact.id + INNER JOIN civicrm_email email ON queue.email_id = email.id + WHERE queue.id = ' . CRM_Utils_Type::escape($queue_id, 'Integer') ); $eq->fetch();