diff --git a/e107_core/templates/email_template.php b/e107_core/templates/email_template.php
index c9e5e5304..68efcc7df 100644
--- a/e107_core/templates/email_template.php
+++ b/e107_core/templates/email_template.php
@@ -10,44 +10,10 @@
*
*/
-
/**
* This file defines the default templates for each type of email which may be sent.
* In general it is assumed that HTML emails are being sent (with a plain text alternate part), although simple plain text emails are also possible.
*
- * Default values are defined for the key elements of an email:
- *
- * $EMAIL_HEADER - the first part of the email, usually defining the headers, and everything up to and including
- * $EMAIL_FOOTER - the last part of the email - it may include a displayed footer, as well as and other 'closing' tags
- *
- * Taken as a pair, $EMAIL_HEADER.$EMAIL_FOOTER must generate standards-compliant XHTML
- *
- * $EMAIL_BODY - the body text of the email - essentially, the message. It gets sandwiched between $EMAIL_HEADER and $EMAIL_FOOTER
- * This must generate standards-compliant XHTML in its own right, when taken with an appropriate header and footer section.
- * Within the template definition, insert the shortcode '{BODY}' to indicate where the passed text of the email is to be stored.
- *
- * $EMAIL_OVERRIDES may optionally be defined, in which case it can override default mailout settings (see later). Only define this variable
- * if you explicitly want overrides - a defined, but empty, variable may have unexpected consequences!
- *
- * $EMAIL_PLAINTEXT - an alternative template for the alternative text part of HTML emails. Set to empty string if hard-coded default to be used
- *
- *
- * Templates may be defined for specific purposes
- * Each template is given a name, which is the name of the variable.
- * This variable may be a simple string, in which case it defines the email body, and is only available via code.
- * Alternatively the variable may be an array, in which case each element of the array defines a different aspect of the email:
- *
- * $NAME['template_name'] is a user-friendly name shown in the mass mailer
- * $NAME['template_type'] takes values (user|system|all) to define its purpose - only 'user' and 'all' templates are shown in the mass mailer
- * $NAME['email_header'] defines the header - optional
- * $NAME['email_footer'] defines the footer - optional
- * $NAME['email_body'] defines the body text
- * $NAME['email_overrides'] defines any mailout settings which are to be overridden (see later) - optional
- *
- * The format and functionality of these four main array elements correspond exactly to those of the defaults already described.
- *
- * The template need only define those variables which are to be overridden, in which case the default definitions will be used for the others.
- *
*
* For templated HTML emails, a style sheet MUST be specified in the header field (if its required), in one of the following forms:
*
@@ -75,7 +41,7 @@ if (!defined('e107_INIT')) { exit; }
// @TODO: Move signup email into templated form
$includeSiteButton = e107::getPref('sitebutton');
-
+/*
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96.' {SITENAME}';
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
$SIGNUPEMAIL_LINKSTYLE = ''; // css to use on links eg. color:red;
@@ -84,7 +50,7 @@ $SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of th
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
$SIGNUPEMAIL_BACKGROUNDIMAGE = ""; // absolute path to a background image eg. e_IMAGE."mybackground.jpg";
-
+*/
/*===========================================================================
@@ -121,6 +87,7 @@ $EMAIL_OVERRIDES = array(
*/
// Not used in signup email
+/*
$EMAIL_HEADER = "
@@ -144,58 +111,15 @@ $EMAIL_FOOTER = "
$EMAIL_PLAINTEXT = '';
-
-/*===========================================================================
- TEMPLATES FOR SPECIFIC EMAIL TYPES
-=============================================================================*/
-
-/**
-Each template is an array whose name must match that used in the code.
-The array has two mandatory elements (name and type).
-The array may have up to five optional elements, each of which overrides the corresponding default value if present
-An empty element sets the field to empty.
-An element that is not present results in the default being used.
-
-Elements are as follows:
- 'template_name' - string - mandatory - a 'user-friendly' name for display
- 'template_type' - string(user|system|all) - mandatory - 'all' and 'user' templates are available for selection in the bulk mailer
- 'email_overrides' - an array
- 'email_header' - string
- 'email_body' - string
- 'email_footer' - string
- 'email_plainText' - string
-
-// If everything is standard apart from the body, the body can be defined as a simple variable
-
*/
-//TODO - integrate into mailout routine
-/*
-$MAILOUT_HEADER = "
-
-
-
-{STYLESHEET}
-
-
-
";
}
- $emailBody = $eml['email_body'];
+ $emailBody = $eml['body'];
- if (vartrue($eml['email_subject'])) $this->Subject = $tp->parseTemplate($eml['email_subject'], true, varset($eml['shortcodes'],null));
+ if (vartrue($eml['subject'])) $this->Subject = $tp->parseTemplate($eml['subject'], true, varset($eml['shortcodes'],null));
e107::getMessage()->addDebug("Couldn't find email template: ".$eml['template']);
}
}
else
{
- if (vartrue($eml['email_subject'])) $this->Subject = $tp->parseTemplate($eml['email_subject'], true, varset($eml['shortcodes'],null));
- // $eml['email_body'] = ($tp->toEmail($tmpl['header']). str_replace('{BODY}', $eml['email_body'], $tmpl['body']). $tp->toEmail($tmpl['footer']));
+ if (vartrue($eml['subject'])) $this->Subject = $tp->parseTemplate($eml['subject'], true, varset($eml['shortcodes'],null));
+ // $eml['body'] = ($tp->toEmail($tmpl['header']). str_replace('{BODY}', $eml['body'], $tmpl['body']). $tp->toEmail($tmpl['footer']));
}
-
+
+
if (isset($eml['SMTPDebug'])) $this->SMTPDebug = $eml['SMTPDebug']; // 'FALSE' is a valid value!
- if (vartrue($eml['email_sender_email'])) $this->From = $eml['email_sender_email'];
- if (vartrue($eml['email_sender_name'])) $this->FromName = $eml['email_sender_name'];
- if (vartrue($eml['email_replyto'])) $this->AddAddressList('replyto',$eml['email_replyto'],vartrue($eml['email_replytonames'],''));
+ if (vartrue($eml['sender_email'])) $this->From = $eml['sender_email'];
+ if (vartrue($eml['sender_name'])) $this->FromName = $eml['sender_name'];
+ if (vartrue($eml['replyto'])) $this->AddAddressList('replyto',$eml['replyto'],vartrue($eml['replytonames'],''));
if (isset($eml['send_html'])) $this->allow_html = $eml['send_html']; // 'FALSE' is a valid value!
if (isset($eml['add_html_header'])) $this->add_HTML_header = $eml['add_html_header']; // 'FALSE' is a valid value!
- if (vartrue($eml['email_body'])) $this->makeBody($eml['email_body'], $this->allow_html, $this->add_HTML_header);
- if (vartrue($eml['email_attach'])) $this->attach($eml['email_attach']);
- if (vartrue($eml['email_copy_to'])) $this->AddAddressList('cc',$eml['email_copy_to'],vartrue($eml['email_cc_names'],''));
- if (vartrue($eml['email_bcopy_to'])) $this->AddAddressList('bcc',$eml['email_bcopy_to'],vartrue($eml['email_bcc_names'],''));
+ if (vartrue($eml['body'])) $this->makeBody($eml['body'], $this->allow_html, $this->add_HTML_header);
+ if (vartrue($eml['attach'])) $this->attach($eml['attach']);
+ if (vartrue($eml['copy_to'])) $this->AddAddressList('cc',$eml['copy_to'],vartrue($eml['cc_names'],''));
+ if (vartrue($eml['bcopy_to'])) $this->AddAddressList('bcc',$eml['bcopy_to'],vartrue($eml['bcc_names'],''));
if (vartrue($eml['bouncepath']))
{
@@ -680,8 +692,8 @@ class e107Email extends PHPMailer
if (vartrue($eml['returnreceipt'])) $this->ConfirmReadingTo = $eml['returnreceipt'];
- if (vartrue($eml['email_inline_images'])) $this->addInlineImages($eml['email_inline_images']);
- if (vartrue($eml['email_priority'])) $this->Priority = $eml['email_priority'];
+ if (vartrue($eml['inline_images'])) $this->addInlineImages($eml['inline_images']);
+ if (vartrue($eml['priority'])) $this->Priority = $eml['priority'];
if (vartrue($eml['e107_header'])) $this->AddCustomHeader("X-e107-id: {$eml['e107_header']}");
if (vartrue($eml['extra_header']))
{
@@ -714,23 +726,24 @@ class e107Email extends PHPMailer
Where parameter not present in the array, doesn't get changed - useful for bulk mailing
If doing bulk mailing with repetitive calls, set $bulkmail parameter true, and must call allSent() when completed
Some of these parameters have been made compatible with the array calculated by render_email() in signup.php
+ *
Possible array parameters:
- $eml['email_subject']
- $eml['email_sender_email'] - 'From' email address
- $eml['email_sender_name'] - 'From' name
- $eml['email_replyto'] - Optional 'reply to' field
- $eml['email_replytonames'] - Name(s) corresponding to 'reply to' field - only used if 'replyto' used
+ $eml['subject']
+ $eml['sender_email'] - 'From' email address
+ $eml['sender_name'] - 'From' name
+ $eml['replyto'] - Optional 'reply to' field
+ $eml['replytonames'] - Name(s) corresponding to 'reply to' field - only used if 'replyto' used
$eml['send_html'] - if TRUE, includes HTML part in messages (only those added after this flag)
$eml['add_html_header'] - if TRUE, adds the 2-line DOCTYPE declaration to the front of the HTML part (but doesn't add ...)
- $eml['email_body'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
- $eml['email_attach'] - string if one file, array of filenames if one or more.
- $eml['email_copy_to'] - comma-separated list of cc addresses.
- $eml['email_cc_names'] - comma-separated list of cc names. Optional, used only if $eml['email_copy_to'] specified
- $eml['email_bcopy_to'] - comma-separated list
- $eml['email_bcc_names'] - comma-separated list of bcc names. Optional, used only if $eml['email_copy_to'] specified
+ $eml['body'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
+ $eml['attach'] - string if one file, array of filenames if one or more.
+ $eml['copy_to'] - comma-separated list of cc addresses.
+ $eml['cc_names'] - comma-separated list of cc names. Optional, used only if $eml['copy_to'] specified
+ $eml['bcopy_to'] - comma-separated list
+ $eml['bcc_names'] - comma-separated list of bcc names. Optional, used only if $eml['copy_to'] specified
$eml['bouncepath'] - Sender field (used for bounces)
$eml['returnreceipt'] - email address for notification of receipt (reading)
- $eml['email_inline_images'] - array of files for inline images
+ $eml['inline_images'] - array of files for inline images
$eml['priority'] - Email priority (1 = High, 3 = Normal, 5 = low)
$eml['e107_header'] - Adds specific 'X-e107-id:' header
$eml['extra_header'] - additional headers (format is name: value
diff --git a/e107_handlers/mailout_admin_class.php b/e107_handlers/mailout_admin_class.php
index a14c3b37d..6b09b994d 100644
--- a/e107_handlers/mailout_admin_class.php
+++ b/e107_handlers/mailout_admin_class.php
@@ -2043,7 +2043,7 @@ class mailoutAdminClass extends e107MailManager
{
$ret = array();
- $templates = e107::getCoreTemplate('email');
+ $templates = e107::getCoreTemplate('email', false, 'front', false);
foreach($templates as $key => $layout)
{