Comala Workflows - Send email escalation for expired states

This script will send an email with a list of pages that have an expired state.

//select expired pages
number [] pages = 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 p in pages) {
	//add expired page to email HTML
	body += "<li><a href=\"" + p.tinyLink + "\">" + p.title + "</a></li>";
//close out HTML
body += "</ul>";

string [] to = {"", ""};
string [] cc = {"", ""};

sendEmail("", to, cc, "These pages need your attention!", body);

See Other Recipes

See More Documentation