1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Added mail preview window to admin->mailout.

This commit is contained in:
Cameron
2014-10-18 03:19:45 -07:00
parent 9eb415abae
commit f689d6ae9c
4 changed files with 49 additions and 3 deletions

View File

@@ -354,8 +354,15 @@ class mailout_main_ui extends e_admin_ui
function init()
{
$action = varset($_GET['mode'], 'main');
$this->mailAdmin = new mailoutAdminClass($action);
if($_GET['action'] == 'preview')
{
echo $this->previewPage();
exit;
}
if ($this->mailAdmin->loadMailHandlers() == 0)
{
e107::getMessage()->addDebug('No mail handlers loaded!!');
@@ -578,8 +585,25 @@ class mailout_main_ui extends e_admin_ui
}
/**
* Preview the Email.
*/
function previewPage()
{
$mailData = e107::getDb()->retrieve('mail_content','*','mail_source_id='.intval($_GET['id'])." LIMIT 1");
$data = $this->mailAdmin->dbToMail($mailData);
$eml = array(
'body' => $data['mail_body'],
'template' => $data['mail_send_style']
);
return e107::getEmail()->preview($eml);
exit;
}