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

View file

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