Added transport class for MailOutput.

This commit is contained in:
2016-08-04 15:52:59 +02:00
parent f237e37a28
commit 1af2c621f4
4 changed files with 45 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ use \Frs\SessionManager;
use \Frs\Output\HtmlOutput;
use \Frs\Output\MailOutput;
use \Frs\Output\Transport\StdoutTransport;
use \Frs\Output\Transport\MailTransport;
$stdout = new StdoutTransport();
$ho = new HtmlOutput($stdout, dirname(__FILE__) . '/templates');
@@ -70,7 +71,8 @@ if (!$tpl_done && $sm->hasSessionToken()) {
switch ($action) {
case 'send':
echo 'This would send the mail...';
$mo = new MailOutput(dirname(__FILE__) . '/templates');
$mt = new MailTransport();
$mo = new MailOutput($mt, dirname(__FILE__) . '/templates');
$form_type = $_REQUEST['form_type'];
$mo->setTemplate('mail_' . $form_type);
$skey = 'form_' . $form_type;