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:
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user