Select SQL:
select group_concat('http://K1000_WEBSITE_URL/userui/ticket.php?ID=', T.ID, "\r\n Title: ", T.TITLE SEPARATOR "\r\n\r\n") as TICKETS, APPROVER.EMAIL as A_EMAIL from HD_TICKET T
left join USER APPROVER on APPROVER.ID = T.APPROVER_ID
where T.APPROVAL != 'Approved'
and T.APPROVER_ID != 0
and T.HD_QUEUE_ID = 13
GROUP BY APPROVER.FULL_NAME
Email each recipient in query results:
Subject: The following ticket(s) needs your approval
Column containing email addresses: A_EMAIL
Message:
Please review the following ticket(s) for approval:
$tickets
Run on a schedule as needed.
Comments