Skip to content

Commit

Permalink
show mail-content in iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
floriansemm committed May 1, 2014
1 parent 8ba11bf commit b85faba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion views/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
<td>{{ loop.index }}</td>
<td>{{ mail.recipient }}</td>
<td>{{ mail.subject }}</td>
<td>{{ mail.content }}</td>

<td><iframe width="100%" height="100%" src="/content/{{ mail.rowid }}"></iframe> </td>
<td>{{ mail.sent|date("m/d/Y H:i:s") }}</td>
</tr>
{% endfor %}
Expand Down
9 changes: 8 additions & 1 deletion web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@

$app->get('/', function() use ($app) {

$sentMails = $app['db']->fetchAll("SELECT * FROM sent_mails ORDER BY sent DESC");
$sentMails = $app['db']->fetchAll("SELECT sm.rowid, sm.* FROM sent_mails sm ORDER BY sent DESC");

return $app['twig']->render('index.html.twig', array('mails' => $sentMails));

});

$app->get('/content/{id}', function (Silex\Application $app, $id) {

$content = $app['db']->fetchAssoc("SELECT content FROM sent_mails WHERE rowid = ?", array($id));

return $content['content'];
});

$app->run();

0 comments on commit b85faba

Please sign in to comment.