It was asked of me how one would send the previous day's Data Point events in an email. One can achieve this pretty easily with a Scripting data source and a custom FTL model, like,

Scripting data source script (will send an email at validation!):

var now = new Date().getTime();
var from = now - 86400000;
var recipients = ["you@doman.extension"];

var eventList = com.serotonin.m2m2.db.dao.EventDao.instance.search(0, "DATA_POINT", null, -1, null, from, 
  now, 1, com.serotonin.m2m2.Common.getTranslations(), java.lang.Integer.MIN_VALUE, java.lang.Integer.MAX_VALUE, null);

var model = {"eventList": eventList, "CODES": com.serotonin.m2m2.rt.event.AlarmLevels.CODES};
var template = com.serotonin.m2m2.Common.freemarkerConfiguration.getTemplate("mytemplate.ftl");
var writer = new java.io.StringWriter();
template.process(model, writer);
var emailContent = new com.serotonin.web.mail.EmailContent(null, writer.toString(), com.serotonin.m2m2.Common.UTF8);

com.serotonin.m2m2.rt.maint.work.EmailWorkItem.queueEmail(recipients, "Event Summary", emailContent, null);

and then an email template like the following (saved in Mango/overrides/ftl, but you may need to restart if you didn't already have an overrides/ftl folder, or saved in Mango/ftl/)

<html>
<head>
<style>
.rowHeader td {
  font-weight: bold;
  color: #FFFFFF;
  background-color: #F07800;
  text-align: center;
  white-space: nowrap;
  padding: 3px 10px 3px 10px;
}
.row td, .rowAlt td {
  color: #000000;
  padding: 3px;
}
.row td {
  background-color: #F0F0F0;
}
.rowAlt td {
  background-color: #DCDCDC;
}
</style>
</head>
<body>
<#assign row = 1/>
<table>
<tr class="rowHeader">
	<th>Alarm Level</th>
	<th>Time</th>
	<th>Message</th>
	<th>Status</th>
	<th>Acknowledged</th>
<tr>
<#list eventList as event>
<#assign row = row + 1/>
<#if row == 2><#assign row = 0/></#if>
<tr class="row<#if row == 1>Alt</#if>">
  <td>${CODES.getCode(event.getAlarmLevel())}</td>
  <td>${event.getPrettyActiveTimestamp()}</td>
  <td>${event.getMessageString()}</td>
  <td><#if event.isRtnApplicable() && !event.isActive()>
    ${event.getPrettyRtnTimestamp()}
  <#else>No RTN</#if></td>
  <td><#if event.isAcknowledged()>
    ${event.getFullPrettyAcknowledgedTimestamp()}
  <#else>No Ack</#if></td>
</tr>
</#list>
</table>
</body>
</html>

One can see in the script that the name of my template file is mytemplate.ftl