//select expired issuespages
number [] issuespages = selectPages("stateexpiry < startOfDay()");
//Create HTML message for email
string body = "<p>The following pages are past the expiry date:</p>";
body += "<ul>";
//loop through each expired page
for(number ip in issuespages) {
//add expired page to email HTML
body += "<li><a href=\"" + ip.tinyLink + "\">" + ip.title + "</a></li>";
}
//close out HTML
body += "</ul>";
string [] to = {"john.doe@email.com", "jane.doe@email.com"};
string [] cc = {"jack.doe@email.com", "jeff.doe@email.com"};
sendEmail("", to, cc, "These pages need your attention!", body); |