KEYCLOAK-543 Set sent date on emails

This commit is contained in:
Stian Thorgersen 2014-06-27 12:19:56 +01:00
parent 3b1d8fd8fe
commit 93c896b4f7
2 changed files with 6 additions and 3 deletions

View file

@ -17,6 +17,7 @@ import javax.mail.Session;
import javax.mail.Transport; import javax.mail.Transport;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@ -130,6 +131,7 @@ public class FreeMarkerEmailProvider implements EmailProvider {
msg.setSubject(subject); msg.setSubject(subject);
msg.setText(body); msg.setText(body);
msg.saveChanges(); msg.saveChanges();
msg.setSentDate(new Date());
Transport transport = session.getTransport("smtp"); Transport transport = session.getTransport("smtp");
if (auth) { if (auth) {

View file

@ -7,17 +7,18 @@
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>
<tr> <tr>
<th>From</th> <th>Date</th>
<th>To</th> <th>To</th>
<th>From</th>
<th>Subject</th> <th>Subject</th>
<th>Body</th> <th>Body</th>
</tr> </tr>
</thead> </thead>
<tr data-ng-repeat="m in messages|reverse"> <tr data-ng-repeat="m in messages|reverse">
<td>{{m.from}}</td> <td>{{m.date|date:'medium'}}</td>
<td>{{m.to}}</td> <td>{{m.to}}</td>
<td>{{m.from}}</td>
<td>{{m.subject}}</td> <td>{{m.subject}}</td>
<td><pre>{{m.body}}</pre></td> <td><pre>{{m.body}}</pre></td>
<td>{{m.date|date:'medium'}}</td>
</tr> </tr>
</table> </table>