Sending template email through scheduled functions

Sending template email through scheduled functions

Hi all, I want to write a scheduled functions, which will run at 7pm, such that it goes through all contacts, and if the contact record is updated between 3pm and 6pm, and the contact status = x, then email template A will be triggered for the contact, and if the contact status = y, then email template B will be triggered.  In either case, a notification will be sent to cliq on channel "crm-updates" stating that "email <A/B> was send to <ContactName> at 7pm"

I know how to iterate through the contacts and see check the date and time, but not sure how to trigger a custom email template and send the message to cliq.  Your help will be appreciated.