1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 19:00:26 +02:00

More mail fixes.

This commit is contained in:
Cameron
2015-05-13 02:03:36 -07:00
parent d84d166b2b
commit 3de9381d60
4 changed files with 46 additions and 23 deletions

View File

@@ -480,8 +480,14 @@ class mailout_main_ui extends e_admin_ui
'subject' => LAN_MAILOUT_113." ".$add,
'body' => str_replace("[br]", "\n", LAN_MAILOUT_114),
'template' => vartrue($_POST['testtemplate'],null),
'shortcodes' => array('USERID'=>555, 'USERNAME'=>'John Smith', 'LOGINNAME'=>'TestName', 'PASSWORD'=>'xxxxxxx', 'ACTIVATION_LINK'=>SITEURL."signup.php#activate"),
);
'shortcodes' => $this->getExampleShortcodes(),
'media' => array(
0 => array('path' => '{e_PLUGIN}gallery/images/butterfly.jpg'),
1 => array('path' => 'h-v880sXEOQ.youtube'),
)
);
if(E107_DEBUG_LEVEL > 0)
{
@@ -691,27 +697,14 @@ class mailout_main_ui extends e_admin_ui
else
{
e107::coreLan('signup');
$tp = e107::getParser();
$eml = array(
'subject' => 'Test Subject',
'body' => "This is the body text of your email. Included are example media attachments such as images and video thumbnails.<br /></br >Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam volutpat risus, a efficitur ex dignissim ac. Phasellus ornare tortor est, a elementum orci finibus non! Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce feugiat bibendum venenatis. Ut sit amet purus id magna consequat euismod vitae ac elit. Maecenas rutrum nisi metus, sed pulvinar velit fermentum eu? Aliquam erat volutpat.<br />
Ut risus massa, consequat et gravida vitae, tincidunt in metus. Nam sodales felis non tortor faucibus lacinia! Integer neque libero, maximus eu cursus nec, fringilla varius erat. Phasellus elementum scelerisque mauris at fermentum. Aliquam erat volutpat. Aliquam sit amet placerat leo, vitae mollis purus. Nulla laoreet nulla pretium risus placerat, a luctus risus pulvinar. Duis ut dolor sed arcu aliquam dictum sed auctor magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam eleifend in mi lobortis blandit. Aliquam vestibulum rhoncus vestibulum. Cras metus.",
'template' => $id,
'shortcodes' => array(
'USERNAME' =>'test-username',
'EMAIL' => 'test@email.com',
'DISPLAYNAME' => 'John Example',
'USERID' =>'555',
'MAILREF' => '123',
'NEWSLETTER' => SITEURL."newsletter/?id=example1234567",
'UNSUBSCRIBE' => SITEURL."unsubscribe.php?id=example1234567",
'UNSUBSCRIBE_MESSAGE'=> "This email was sent to test@email.com. If you don't want to receive these emails in the future, please <a href='".SITEURL."unsubscribe.php?id=example1234567'>unsubscribe</a>. ",
'ACTIVATION_LINK' => "<a href='http://whereever.to.activate.com/'>http://whereever.to.activate.com/</a>",
'USERURL' => "www.user-website.com",
'PASSWORD' => "test-password",
'LOGINNAME' => "test-loginname"
),
'shortcodes' => $this->getExampleShortcodes(),
'media' => array(
0 => array('path' => '{e_PLUGIN}gallery/images/butterfly.jpg'),
1 => array('path' => 'h-v880sXEOQ.youtube'),
@@ -726,6 +719,34 @@ class mailout_main_ui extends e_admin_ui
return e107::getEmail()->preview($eml);
exit;
}
function getExampleShortcodes()
{
$tp = e107::getParser();
return array(
'USERNAME' =>'test-username',
'EMAIL' => 'test@email.com',
'DISPLAYNAME' => 'John Example',
'USERID' =>'555',
'MAILREF' => '123',
'NEWSLETTER' => SITEURL."newsletter/?id=example1234567",
'UNSUBSCRIBE' => SITEURL."unsubscribe.php?id=example1234567",
'UNSUBSCRIBE_MESSAGE'=> "This email was sent to test@email.com. If you don't want to receive these emails in the future, please <a href='".SITEURL."unsubscribe.php?id=example1234567'>unsubscribe</a>. ",
'ACTIVATION_LINK' => "<a href='http://whereever.to.activate.com/'>http://whereever.to.activate.com/</a>",
'USERURL' => "www.user-website.com",
'PASSWORD' => "test-password",
'LOGINNAME' => "test-loginname",
'SUBJECT' => "Test Subject",
'DATE_SHORT' => $tp->toDate(time(),'short'),
'DATE_LONG' => $tp->toDate(time(),'long'),
);
}
function templatesPage()

View File

@@ -193,7 +193,7 @@ $EMAIL_TEMPLATE['quickadduser']['footer'] = $EMAIL_TEMPLATE['default']['footer'
// ------- Notify (@see admin-> notify)
$EMAIL_TEMPLATE['notify']['name'] = 'Notify';
$EMAIL_TEMPLATE['notify']['subject'] = '{SITENAME}: {SUBJECT} ';
$EMAIL_TEMPLATE['notify']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
<html xmlns='http://www.w3.org/1999/xhtml' >

View File

@@ -542,7 +542,7 @@ class e107Email extends PHPMailer
if ($want_HTML !== FALSE)
{
$message = e107::getParser()->toHtml("[html]".$message."[/html]",true);
// $message = e107::getParser()->toHtml("[html]".$message."[/html]",true); // using toHtml will break media attachment links. (need to retain {e_XXXX )
if ($this->debug) echo "Generating multipart email<br />";
if ($add_HTML_header)

View File

@@ -833,7 +833,7 @@ class mailoutAdminClass extends e107MailManager
{
// Can be a template name now
$errList[] = LAN_MAILOUT_205;
break;
// break;
}
else
{
@@ -914,7 +914,7 @@ class mailoutAdminClass extends e107MailManager
$text .= $this->getUserName($val);
break;
case 'sdatetime':
$text .= $gen->convert_date($val, 'short');
$text .= $tp->toDate($val, 'short');
break;
case 'trunc200':
@@ -1244,6 +1244,8 @@ class mailoutAdminClass extends e107MailManager
{
$mes = e107::getMessage();
$ns = e107::getRender();
$frm = e107::getForm();
$mailData = $this->retrieveEmail($mailId);
@@ -1254,7 +1256,7 @@ class mailoutAdminClass extends e107MailManager
exit ;
}
$text .= "
$text = "
<form action='" . e_SELF . "?mode=saved' id='email_show_template' method='post'>
<fieldset id='email-show-template'>
<table class='table adminlist'>