mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 17:39:46 +01:00
First cut of updated bulk mail handling, including support for provision of email addresses by plugins. Still very much a work in progress, but should send some sort of email if treated nicely.
This commit is contained in:
parent
1c660784d6
commit
24b8dfd54f
@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org/).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $
|
||||
| $Revision: 1.14 $
|
||||
| $Date: 2009-11-10 15:33:00 $
|
||||
| $Author: marj_nl_fr $
|
||||
| $Revision: 1.15 $
|
||||
| $Date: 2009-11-15 17:38:04 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -50,7 +50,8 @@ class cron
|
||||
$this->cronAction = e_QUERY;
|
||||
|
||||
$this->coreCrons['_system_cron'] = array(
|
||||
0 => array('name' => "Test Email", 'function' => "sendEmail", 'description' => "Send a test email to ".$pref['siteadminemail']."<br />Recommended to test the scheduling system."),
|
||||
0 => array('name' => 'Test Email', 'function' => 'sendEmail', 'description' => 'Send a test email to '.$pref['siteadminemail'].'<br />Recommended to test the scheduling system.'),
|
||||
1 => array('name' => 'Mail Queue', 'function' => 'procEmailQueue', 'description' => 'Process mail queue'),
|
||||
// 1 => array('name'=>'User Purge', 'function' => 'userPurge', 'description'=>'Purge Unactivated Users'),
|
||||
// 2 => array('name'=>'User UnActivated', 'function' => 'userUnactivated', 'description'=>'Resend activation email to unactivated users.'),
|
||||
// 3 => array('name'=>'News Sticky', 'function' => 'newsPurge', 'description'=>'Remove Sticky News Items')
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,13 +10,14 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/cron_class.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-10-24 12:01:24 $
|
||||
| $Author: e107coders $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-11-15 17:38:04 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
define ('CRON_MAIL_DEBUG', TRUE);
|
||||
class _system_cron
|
||||
{
|
||||
|
||||
@ -32,14 +33,28 @@ class _system_cron
|
||||
function sendEmail() // Test Email.
|
||||
{
|
||||
global $pref;
|
||||
require_once(e_HANDLER."mail.php");
|
||||
require_once(e_HANDLER.'mail.php');
|
||||
$message = "Your Cron test worked correctly. Sent at ".date("r").".";
|
||||
|
||||
|
||||
sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron.".date("r"), $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function procEmailQueue()
|
||||
{
|
||||
global $pref;
|
||||
if (CRON_MAIL_DEBUG)
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
$e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','CRON Email','Email run started',FALSE,LOG_TO_ROLLING);
|
||||
}
|
||||
require_once(e_HANDLER.'mail_manager_class.php');
|
||||
$mailManager = new e107MailManager();
|
||||
$mailManager->doEmailTask(varset($pref['mail_workpertick'],5));
|
||||
if (CRON_MAIL_DEBUG)
|
||||
{
|
||||
$e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','CRON Email','Email run completed',FALSE,LOG_TO_ROLLING);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -48,7 +63,7 @@ class _system_cron
|
||||
|
||||
|
||||
|
||||
/* $Id: cron_class.php,v 1.3 2009-10-24 12:01:24 e107coders Exp $ */
|
||||
/* $Id: cron_class.php,v 1.4 2009-11-15 17:38:04 e107steved Exp $ */
|
||||
|
||||
/**####################################################################################################**\
|
||||
Version: V1.01
|
||||
|
@ -9,8 +9,8 @@
|
||||
* e107 Main
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mail.php,v $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2009-09-01 19:53:07 $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2009-11-15 17:38:04 $
|
||||
* $Author: e107steved $
|
||||
*/
|
||||
|
||||
@ -26,7 +26,6 @@ Three main scenarios to handle:
|
||||
- Personalised mailshots - template email modified to personalise for each recipient (based on DB list)
|
||||
|
||||
TODO:
|
||||
1. Look at VERP - implement and check
|
||||
2. Bulk mailing - look at using the batching constants with SMTPKeepAlive to reset the connection every so often
|
||||
3. mail (PHP method) - note that it has parameters for additional headers and other parameters
|
||||
4. Check that language support works - PHPMailer defaults to English if other files not available
|
||||
@ -35,20 +34,15 @@ TODO:
|
||||
- Use rolling log for errors - error string(s) available - sort out entry
|
||||
- Look at support of some other logging options
|
||||
- Debug option to just log, not send emails (variables in place, and supported by current bulk mailer)
|
||||
6. Capability to identify and log caller (for tracking down which bit of code sent emails)
|
||||
7. Look at how cc, bcc addresses are handled in bulk mailing scenarios - may need to disable them on later sends.
|
||||
8. Include theme info in header if enabled?
|
||||
9. Make sure SMTPDebug can be set (TRUE/FALSE)
|
||||
10. Get rid of mime_content_type() - deprecated (function $this->mime_types() does something similar, given a file extension)
|
||||
11. Add public/protected/private to all functions and variables
|
||||
12. Check support for port number - ATM we just override for SSL. Looks as if phpmailer can take it from end of server link.
|
||||
13. Possibly strip bbcode from plain text mailings
|
||||
14. Note option for class constants
|
||||
16. Add a routine or class which adds a list of recipients and an email to the mailout DB
|
||||
13. Possibly strip bbcode from plain text mailings - best done by caller?
|
||||
18. Note object iteration - may be useful for dump of object state
|
||||
19. Consider overriding error handler
|
||||
20. Look at using new prefs structure
|
||||
21. Should we always send an ID?
|
||||
22. Force singleton so all mail sending flow controlled a bit
|
||||
|
||||
|
||||
Tested so far (with PHP4 version)
|
||||
@ -137,7 +131,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
//define('MAIL_DEBUG',TRUE);
|
||||
define('LOG_CALLER', TRUE);
|
||||
//define('LOG_CALLER', TRUE);
|
||||
|
||||
require_once(e_HANDLER.'phpmailer/class.phpmailer.php');
|
||||
|
||||
@ -237,7 +231,7 @@ class e107Email extends PHPMailer
|
||||
$pop->Authorise($overrides['smtp_server'], 110, 30, $overrides['smtp_username'], $overrides['smtp_password'], 1);
|
||||
}
|
||||
|
||||
$this->Mailer = "smtp";
|
||||
$this->Mailer = 'smtp';
|
||||
$this->localUseVerp = isset($smtp_options['useVERP']);
|
||||
if (isset($smtp_options['secure']))
|
||||
{
|
||||
@ -245,7 +239,7 @@ class e107Email extends PHPMailer
|
||||
{
|
||||
case 'TLS' :
|
||||
$this->SMTPSecure = 'tls';
|
||||
$this->Port = 465; // Can also use port 587
|
||||
$this->Port = 465; // Can also use port 587, and maybe even 25
|
||||
break;
|
||||
case 'SSL' :
|
||||
$this->SMTPSecure = 'ssl';
|
||||
@ -322,10 +316,10 @@ class e107Email extends PHPMailer
|
||||
}
|
||||
if ($this->logHandle !== FALSE)
|
||||
{
|
||||
fwrite($this->logHandle,"=====".date('H:i:s y.m.d')."----------------------------------------------------------------=====\r\n");
|
||||
fwrite($this->logHandle,"\n\n=====".date('H:i:s y.m.d')."----------------------------------------------------------------=====\r\n");
|
||||
if ($logInfo)
|
||||
{
|
||||
fwrite($this->logHandle,' Start of mail run by '.USERNAME." - {$count} emails to go. ID: {$mail_id}. Subject: {$mail_subject}\r\n");
|
||||
fwrite($this->logHandle,' Mailer opened by '.USERNAME." - ID: {$mail_id}. Subject: {$this->Subject} Log action: {$this->logEnable}\r\n");
|
||||
if ($this->add_email)
|
||||
{
|
||||
fwrite($this->logHandle, 'From: '.$this->From.' ('.$this->FromName.")\r\n");
|
||||
@ -587,24 +581,25 @@ class e107Email extends PHPMailer
|
||||
public function arraySet($paramlist)
|
||||
{
|
||||
if (isset($paramlist['SMTPDebug'])) $this->SMTPDebug = $paramlist['SMTPDebug']; // 'FALSE' is a valid value!
|
||||
if (varsettrue($paramlist['subject'])) $this->Subject = $paramlist['subject'];
|
||||
if (varsettrue($paramlist['from'])) $this->From = $paramlist['from'];
|
||||
if (varsettrue($paramlist['fromname'])) $this->FromName = $paramlist['fromname'];
|
||||
if (varsettrue($paramlist['replyto'])) $this->AddAddressList('replyto',$paramlist['replyto'],varsettrue($paramlist['replytonames'],''));
|
||||
if (varsettrue($paramlist['mail_subject'])) $this->Subject = $paramlist['mail_subject'];
|
||||
if (varsettrue($paramlist['mail_sender_email'])) $this->From = $paramlist['mail_sender_email'];
|
||||
if (varsettrue($paramlist['mail_sender_name'])) $this->FromName = $paramlist['mail_sender_name'];
|
||||
if (varsettrue($paramlist['mail_replyto'])) $this->AddAddressList('replyto',$paramlist['mail_replyto'],varsettrue($paramlist['mail_replytonames'],''));
|
||||
if (isset($paramlist['send_html'])) $this->allow_html = $paramlist['send_html']; // 'FALSE' is a valid value!
|
||||
if (isset($paramlist['add_html_header'])) $this->add_HTML_header = $paramlist['add_html_header']; // 'FALSE' is a valid value!
|
||||
if (varsettrue($paramlist['message'])) $this->makeBody($paramlist['message'], $this->allow_html, $this->add_HTML_header);
|
||||
if (varsettrue($paramlist['attachments'])) $this->attach($paramlist['attachments']);
|
||||
if (varsettrue($paramlist['cc'])) $this->AddAddressList('cc',$paramlist['cc'],varsettrue($paramlist['ccnames'],''));
|
||||
if (varsettrue($paramlist['bcc'])) $this->AddAddressList('bcc',$paramlist['bcc'],varsettrue($paramlist['bccnames'],''));
|
||||
if (varsettrue($paramlist['mail_body'])) $this->makeBody($paramlist['mail_body'], $this->allow_html, $this->add_HTML_header);
|
||||
if (varsettrue($paramlist['mail_attach'])) $this->attach($paramlist['mail_attach']);
|
||||
if (varsettrue($paramlist['mail_copy_to'])) $this->AddAddressList('cc',$paramlist['mail_copy_to'],varsettrue($paramlist['mail_cc_names'],''));
|
||||
if (varsettrue($paramlist['mail_bcopy_to'])) $this->AddAddressList('bcc',$paramlist['mail_bcopy_to'],varsettrue($paramlist['mail_bcc_names'],''));
|
||||
if (varsettrue($paramlist['bouncepath']))
|
||||
{
|
||||
$this->Sender = $paramlist['bouncepath']; // Bounce path
|
||||
$this->save_bouncepath = $paramlist['bouncepath']; // Bounce path
|
||||
}
|
||||
if (varsettrue($paramlist['returnreceipt'])) $this->ConfirmReadingTo = $paramlist['returnreceipt'];
|
||||
if (varsettrue($paramlist['inline-images'])) $this->addInlineImages($paramlist['inline-images']);
|
||||
if (varsettrue($paramlist['priority'])) $this->Priority = $paramlist['priority'];
|
||||
if (varsettrue($paramlist['mail_inline_images'])) $this->addInlineImages($paramlist['mail_inline_images']);
|
||||
if (varsettrue($paramlist['mail_priority'])) $this->Priority = $paramlist['mail_priority'];
|
||||
if (varsettrue($paramlist['e107_header'])) $this->AddCustomHeader("X-e107-id: {$paramlist['e107_header']}");
|
||||
if (varsettrue($paramlist['extra_header']))
|
||||
{
|
||||
if (is_array($paramlist['extra_header']))
|
||||
@ -627,30 +622,35 @@ class e107Email extends PHPMailer
|
||||
}
|
||||
|
||||
|
||||
// Send an email where the bulk of the data is passed in an array. Returns 0 on success.
|
||||
// (Even if the array is null, because everything previously set up, this is the preferred entry point)
|
||||
// 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['subject']
|
||||
// $eml['from']
|
||||
// $eml['fromname']
|
||||
// $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 <head>...</head>
|
||||
// $eml['message'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
|
||||
// $eml['attachments'] - string if one file, array of filenames if one or more.
|
||||
// $eml['cc'] - comma-separated list
|
||||
// $eml['bcc'] - comma-separated list
|
||||
// $eml['bouncepath'] - Sender field (used for bounces)
|
||||
// $eml['returnreceipt'] - email address for notification of receipt (reading)
|
||||
// $eml['inline-images'] - array of files for inline images
|
||||
// $eml['priority'] - Email priority (1 = High, 3 = Normal, 5 = low)
|
||||
// $eml['extra_header'] - additional headers
|
||||
// $eml['wordwrap'] - Set wordwrap value
|
||||
// $eml['split'] - If true, sends an individual email to each recipient
|
||||
/*
|
||||
Send an email where the bulk of the data is passed in an array. Returns 0 on success.
|
||||
(Even if the array is null, because everything previously set up, this is the preferred entry point)
|
||||
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['mail_subject']
|
||||
$eml['mail_sender_email'] - 'From' email address
|
||||
$eml['mail_sender_name'] - 'From' name
|
||||
$eml['mail_replyto'] - Optional 'reply to' field
|
||||
$eml['mail_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 <head>...</head>)
|
||||
$eml['mail_body'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
|
||||
$eml['mail_attach'] - string if one file, array of filenames if one or more.
|
||||
$eml['mail_copy_to'] - comma-separated list of cc addresses.
|
||||
$eml['mail_cc_names''] - comma-separated list of cc names. Optional, used only if $eml['mail_copy_to'] specified
|
||||
$eml['mail_bcopy_to'] - comma-separated list
|
||||
$eml['mail_bcc_names''] - comma-separated list of bcc names. Optional, used only if $eml['mail_copy_to'] specified
|
||||
$eml['bouncepath'] - Sender field (used for bounces)
|
||||
$eml['returnreceipt'] - email address for notification of receipt (reading)
|
||||
$eml['mail_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
|
||||
$eml['wordwrap'] - Set wordwrap value
|
||||
$eml['split'] - If true, sends an individual email to each recipient
|
||||
*/
|
||||
public function sendEmail($send_to, $to_name, $eml = '', $bulkmail = FALSE)
|
||||
{
|
||||
// $e107 = e107::getInstance();
|
||||
@ -681,7 +681,7 @@ class e107Email extends PHPMailer
|
||||
{
|
||||
$result = $this->Send(); // Actually send email
|
||||
|
||||
if (!$bulkmail && $this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose();
|
||||
if (!$bulkmail && !$this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose();
|
||||
}
|
||||
else
|
||||
{ // Debug
|
||||
@ -697,17 +697,23 @@ class e107Email extends PHPMailer
|
||||
$this->SendCount = 0;
|
||||
}
|
||||
|
||||
$this->logLine("Send to {$to_name} at {$send_to} Mail-ID={$mail_custom} - {$result}");
|
||||
$this->logLine("Send to {$to_name} at {$send_to} Mail-ID={$mail_custom} - ".($result ? 'Success' : 'Fail'));
|
||||
|
||||
$this->ClearAddresses(); // In case we send another email
|
||||
$this->ClearCustomHeaders();
|
||||
|
||||
if ($result) return TRUE;
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$this->closeLog();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
$this->logLine('Error info: '.$this->ErrorInfo);
|
||||
// Error sending email
|
||||
$e107 = e107::getInstance();
|
||||
$e107->admin_log->e_log_event(3,debug_backtrace(),"MAIL","Send Failed",$this->ErrorInfo,FALSE,LOG_TO_ROLLING);
|
||||
$this->TotalErrors++;
|
||||
$this->closeLog();
|
||||
return $this->ErrorInfo;
|
||||
}
|
||||
|
||||
@ -764,7 +770,7 @@ class e107Exception extends Exception
|
||||
//-----------------------------------------------------
|
||||
// Legacy interface for backward compatibility
|
||||
//-----------------------------------------------------
|
||||
// (Preferred interface is to instantiate an e107_mail object, then call sendEmail method with an array of parameters
|
||||
// (Preferred interface is to instantiate an e107Mail object, then call sendEmail method with an array of parameters
|
||||
|
||||
// If $send_from is blank, uses the 'replyto' name and email if set, otherwise site admins details
|
||||
// $inline is a comma-separated list of embedded images to be included
|
||||
@ -813,13 +819,12 @@ function sendemail($send_to, $subject, $message, $to_name, $send_from='', $from_
|
||||
|
||||
if (varsettrue($returnreceipt)) $mail->ConfirmReadingTo($returnreceipt);
|
||||
|
||||
if ($mail->sendEmail($send_to,$to_name))
|
||||
if ($mail->sendEmail($send_to,$to_name) === TRUE)
|
||||
{ // Success
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// TODO: Possibly Log this somewhere (sendEmail method logs to rolling log)
|
||||
echo "Mail sending error: ".$mail->ErrorInfo."<br />";
|
||||
// Error info already logged
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
1265
e107_handlers/mail_manager_class.php
Normal file
1265
e107_handlers/mail_manager_class.php
Normal file
File diff suppressed because it is too large
Load Diff
1351
e107_handlers/mailout_admin_class.php
Normal file
1351
e107_handlers/mailout_admin_class.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,248 +1,372 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <EFBFBD>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2009-10-26 01:23:19 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-11-15 17:38:04 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/*
|
||||
Class for 'core' mailout function. Additional mailout sources may replicate the functions of this class under a different name, or may use inheritance.
|
||||
Class for 'core' mailout function.
|
||||
For plugins:
|
||||
- the equivalent file must be called 'e_mailout.php', and reside in the root of the plugin directory.
|
||||
- the classname must be 'mailout_'.$plugdir (e.g. 'mailout_calendar_menu')
|
||||
|
||||
Additional mailout sources may replicate the functions of this class under a different name, or may use inheritance.
|
||||
When managing bulk emails, class calls are made for each data handler.
|
||||
|
||||
In general each class object must be self-contained, and use internal variables for storage
|
||||
|
||||
The class may use the global $sql object for database access - it will effectively have exclusive use of this during the email address search phase
|
||||
The class may use the global $e107->sql object for database access - it will effectively have exclusive use of this during the email address search phase
|
||||
|
||||
It is the responsibility of each class to manager permission restrictions where required.
|
||||
|
||||
TODO:
|
||||
1. accept varying date formats for last visit
|
||||
2. Use XHTML calendar for last visit
|
||||
3. Sort classes for table cells
|
||||
|
||||
*/
|
||||
// These variables determine the circumstances under which this class is loaded (only used during loading, and may be overwritten later)
|
||||
$mailer_include_with_default = TRUE; // Mandatory - if false, show only when mailout for this specific plugin is enabled
|
||||
$mailer_exclude_default = TRUE; // Mandatory - if TRUE, when this plugin's mailout is active, the default isn't loaded
|
||||
$mailerIncludeWithDefault = TRUE; // Mandatory - if false, show only when mailout for this specific plugin is enabled
|
||||
$mailerExcludeDefault = TRUE; // Mandatory - if TRUE, when this plugin's mailout is active, the default (core) isn't loaded
|
||||
|
||||
class core_mailout
|
||||
class mailout_core
|
||||
{
|
||||
var $mail_count = 0;
|
||||
var $mail_read = 0;
|
||||
var $mailer_name = LAN_MAILOUT_68; // Text to identify the source of selector (displayed on left of admin page)
|
||||
var $mailer_enabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
|
||||
protected $mailCount = 0;
|
||||
protected $mailRead = 0;
|
||||
protected $e107;
|
||||
public $mailerSource = 'core'; // Plugin name (core mailer is special case) Must be directory for this file
|
||||
public $mailerName = LAN_MAILOUT_68; // Text to identify the source of selector (displayed on left of admin page)
|
||||
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
|
||||
protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
|
||||
|
||||
// Constructor
|
||||
function core_mailout()
|
||||
{
|
||||
}
|
||||
|
||||
// Data selection routines
|
||||
|
||||
// Initialise data selection - save any queries or other information into internal variables, do initial DB queries as appropriate.
|
||||
// Return number of records available (or 1 if unknown) on success, FALSE on failure
|
||||
// Could in principle read all addresses and buffer them for later routines, if this is more convenient
|
||||
function select_init()
|
||||
{
|
||||
global $sql; // We can use this OK
|
||||
// List of fields used by selectors
|
||||
private $selectFields = array('email_to',
|
||||
'extended_1_name','extended_1_value',
|
||||
'extended_2_name', 'extended_2_value',
|
||||
'user_search_name', 'user_search_value',
|
||||
'last_visit_match', 'last_visit_date'
|
||||
);
|
||||
|
||||
switch ($_POST['email_to'])
|
||||
// Constructor
|
||||
public function __construct(&$mailerAdminHandler = NULL)
|
||||
{
|
||||
// Build the query for the user database
|
||||
case "all" :
|
||||
case "admin" :
|
||||
switch ($_POST['email_to'])
|
||||
$this->e107 = e107::getInstance();
|
||||
if ($mailerAdminHandler == NULL)
|
||||
{
|
||||
case "admin":
|
||||
$insert = "u.user_admin='1' ";
|
||||
break;
|
||||
case "all":
|
||||
$insert = "u.user_ban='0' ";
|
||||
break;
|
||||
global $mailAdmin;
|
||||
$mailerAdminHandler = $mailAdmin;
|
||||
}
|
||||
$qry = ", ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE {$insert} ";
|
||||
break;
|
||||
|
||||
case "unverified" :
|
||||
$qry = " FROM #user AS u WHERE u.user_ban='2'";
|
||||
break;
|
||||
|
||||
case "self" :
|
||||
$qry = " FROM #user AS u WHERE u.user_id='".USERID."'";
|
||||
break;
|
||||
|
||||
default :
|
||||
$insert = "u.user_class REGEXP concat('(^|,)',{$_POST['email_to']},'(,|$)') AND u.user_ban='0' ";
|
||||
$qry = ", ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE {$insert} ";
|
||||
$this->adminHandler = $mailerAdminHandler;
|
||||
}
|
||||
|
||||
|
||||
// Determine which fields we actually need (u.user_sess is the signup link)
|
||||
$qry = "SELECT u.user_id, u.user_name, u.user_email, u.user_sess".$qry;
|
||||
|
||||
if($_POST['extended_1_name'] && $_POST['extended_1_value'])
|
||||
{
|
||||
$qry .= " AND ".$_POST['extended_1_name']." = '".$_POST['extended_1_value']."' ";
|
||||
}
|
||||
|
||||
if($_POST['extended_2_name'] && $_POST['extended_2_value'])
|
||||
{
|
||||
$qry .= " AND ".$_POST['extended_2_name']." = '".$_POST['extended_2_value']."' ";
|
||||
}
|
||||
|
||||
if($_POST['user_search_name'] && $_POST['user_search_value'])
|
||||
{
|
||||
$qry .= " AND u.".$_POST['user_search_name']." LIKE '%".$_POST['user_search_value']."%' ";
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY u.user_name";
|
||||
if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
|
||||
$this->mail_read = 0;
|
||||
return $this->mail_count;
|
||||
}
|
||||
|
||||
|
||||
// Return an email address to add. Return FALSE if no more addresses to add
|
||||
// Returns an array with appropriate elements defined:
|
||||
// 'user_id' - non-zero if a registered user, zero if a non-registered user. (Always non-zero from this class)
|
||||
// 'user_name' - user name
|
||||
// 'user_email' - email address to use
|
||||
// 'user_signup' - signup link (zero if not applicable)
|
||||
function select_add()
|
||||
{
|
||||
global $sql;
|
||||
if (!($row = $sql->db_Fetch())) return FALSE;
|
||||
$ret = array('user_id' => $row['user_id'],
|
||||
'user_name' => $row['user_name'],
|
||||
'user_email' => $row['user_email'],
|
||||
'user_signup' => $row['user_sess']
|
||||
);
|
||||
$this->mail_read++;
|
||||
// echo "Return value: ".$row['user_name']."<br />";
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
// Called once all email addresses read, to do any housekeeping needed
|
||||
function select_close()
|
||||
{
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
|
||||
// Called to show current selection criteria, and optionally allow edit
|
||||
// Returns HTML which is displayed in a table cell. Typically we return a complete table
|
||||
// $allow_edit is TRUE to allow user to change the selection; FALSE to just display current settings
|
||||
|
||||
//TODO - remove HTML markup from this class! (see below)
|
||||
/**
|
||||
* Return data representing the user's selection criteria as entered in the $_POST array.
|
||||
*
|
||||
* This is stored in the DB with a saved email. (Just return an empty string or array if this is undesirable)
|
||||
* The returned value is passed back to selectInit() and showSelect when needed.
|
||||
*
|
||||
* @return Selection data - may be string, array or whatever suits
|
||||
*/
|
||||
public function returnSelectors()
|
||||
{
|
||||
$res = array();
|
||||
foreach ($this->selectFields as $k)
|
||||
{
|
||||
if (varsettrue($_POST[$k]))
|
||||
{
|
||||
$res[$k] = $this->e107->tp->toDB($_POST[$k]);
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to initialise data selection routine.
|
||||
* Needs to save any queries or other information into internal variables, do initial DB queries as appropriate.
|
||||
* Could in principle read all addresses and buffer them for later routines, if this is more convenient
|
||||
*
|
||||
* @param $selectVals - array of selection criteria as returned by returnSelectors()
|
||||
*
|
||||
* @return Return number of records available (or 1 if unknown) on success, FALSE on failure
|
||||
*/
|
||||
public function selectInit($selectVals = FALSE)
|
||||
{
|
||||
$where = array();
|
||||
$incExtended = array();
|
||||
if ($selectVals === FALSE)
|
||||
{
|
||||
$selectVals = array('email_to' => 'all');
|
||||
}
|
||||
switch (varset($selectVals['email_to'], 'all'))
|
||||
{
|
||||
// Build the query for the user database
|
||||
case 'all' :
|
||||
$where[] = 'u.`user_ban`=0';
|
||||
break;
|
||||
case 'admin' :
|
||||
$where[] = 'u.`user_admin`=1';
|
||||
break;
|
||||
case 'unverified' :
|
||||
$where[] = 'u.`user_ban`=2';
|
||||
break;
|
||||
case 'self' :
|
||||
$where[] = 'u.`user_id`='.USERID;
|
||||
break;
|
||||
default :
|
||||
if (is_numeric($selectVals['email_to']))
|
||||
{
|
||||
$where[] = "u.`user_class` REGEXP concat('(^|,)',{$selectVals['email_to']},'(,|$)')";
|
||||
}
|
||||
$where[] = "u.`user_ban`=0";
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
||||
{
|
||||
$where[] = '`'.$selectVals['extended_1_name']."` = '".$selectVals['extended_1_value']."' ";
|
||||
$incExtended[] = $selectVals['extended_1_name'];
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['extended_2_name']) && vartrue($selectVals['extended_2_value']))
|
||||
{
|
||||
$where[] = "ue.`".$selectVals['extended_2_name']."` = '".$selectVals['extended_2_value']."' ";
|
||||
$incExtended[] = $selectVals['extended_2_name'];
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['user_search_name']) && vartrue($selectVals['user_search_value']))
|
||||
{
|
||||
$where[]= "u.`".$selectVals['user_search_name']."` LIKE '%".$selectVals['user_search_value']."%' ";
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['last_visit_match']) && vartrue($selectVals['last_visit_date']))
|
||||
{
|
||||
foreach(array(':', '-', ',') as $sep)
|
||||
{
|
||||
if (strpos($selectVals['last_visit_date'], ':'))
|
||||
{
|
||||
$tmp = explode($sep, $selectVals['last_visit_date']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$lvDate = gmmktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]); // Require dd-mm-yy for now
|
||||
if (($lvDate > 0) && ($lvDate <= time()))
|
||||
{
|
||||
switch ($selectVals['last_visit_match'])
|
||||
{
|
||||
case '<' :
|
||||
case '>' :
|
||||
$where[]= "u.`user_lastvisit`".$selectVals['last_visit_match'].$lvDate;
|
||||
break;
|
||||
case '=' :
|
||||
$where[]= "u.`user_lastvisit`>=".$lvDate;
|
||||
$where[]= "u.`user_lastvisit`<=".intval($lvDate + 86400);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$where[] = "u.`user_email` != ''"; // Ignore all records with empty email address
|
||||
|
||||
// Now assemble the query from the pieces
|
||||
// Determine which fields we actually need (u.user_sess is the signup link)
|
||||
$qry = 'SELECT u.user_id, u.user_name, u.user_email, u.user_loginname, u.user_sess, u.user_lastvisit';
|
||||
if (count($incExtended))
|
||||
{
|
||||
foreach ($incExtended as $if)
|
||||
{
|
||||
$qry .= ', ue.`'.$if.'`';
|
||||
}
|
||||
}
|
||||
$qry .= " FROM `#user` AS u ";
|
||||
if (count($incExtended))
|
||||
{
|
||||
$qry .= "LEFT JOIN `#user_extended` AS ue ON ue.`user_extended_id` = u.`user_id`";
|
||||
}
|
||||
|
||||
$qry .= ' WHERE '.implode(' AND ',$where).' ORDER BY u.user_name';
|
||||
// echo "Selector query: ".$qry.'<br />';
|
||||
if (!( $this->mail_count = $this->e107->sql->db_Select_gen($qry))) return FALSE;
|
||||
$this->mail_read = 0;
|
||||
return $this->mail_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return an email address to add to the recipients list. Return FALSE if no more addresses to add
|
||||
*
|
||||
* @return FALSE if no more addresses available; else an array:
|
||||
* 'mail_recipient_id' - non-zero if a registered user, zero if a non-registered user. (Always non-zero from this class)
|
||||
* 'mail_recipient_name' - user name
|
||||
* 'mail_recipient_email' - email address to use
|
||||
* 'mail_target_info' - array of info which might be substituted into email, usually using the codes defined by the editor.
|
||||
* Array key is the code within '|...|', value is the string for substitution
|
||||
*/
|
||||
public function selectAdd()
|
||||
{
|
||||
if (!($row = $this->e107->sql->db_Fetch(MYSQL_ASSOC))) return FALSE;
|
||||
$ret = array('mail_recipient_id' => $row['user_id'],
|
||||
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
||||
'mail_recipient_email' => $row['user_email'],
|
||||
'mail_target_info' => array(
|
||||
'USERID' => $row['user_id'],
|
||||
'DISPLAYNAME' => $row['user_name'],
|
||||
'SIGNUP_LINK' => $row['user_sess'],
|
||||
'USERNAME' => $row['user_loginname'],
|
||||
'USERLASTVISIT' => $row['user_lastvisit']
|
||||
)
|
||||
);
|
||||
$this->mail_read++;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
// Called once all email addresses read, to do any housekeeping needed
|
||||
public function select_close()
|
||||
{
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
function show_select($allow_edit = FALSE)
|
||||
{
|
||||
global $sql;
|
||||
$ret = "<table style='width:95%'>";
|
||||
|
||||
if ($allow_edit)
|
||||
{
|
||||
// User class select
|
||||
$ret .= " <tr>
|
||||
<td class='forumheader3'>".LAN_MAILOUT_03.": </td>
|
||||
<td class='forumheader3'>
|
||||
".userclasses("email_to", $_POST['email_to'])."</td>
|
||||
</tr>";
|
||||
|
||||
// User Search Field.
|
||||
$u_array = array("user_name"=>LAN_MAILOUT_43,"user_login"=>LAN_MAILOUT_44,"user_email"=>LAN_MAILOUT_45);
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td style='width:35%' class='forumheader3'>".LAN_MAILOUT_46."
|
||||
<select name='user_search_name' class='tbox'>
|
||||
<option value=''> </option>";
|
||||
|
||||
foreach ($u_array as $key=>$val)
|
||||
{
|
||||
$ret .= "<option value='{$key}' >".$val."</option>\n";
|
||||
}
|
||||
$ret .= "
|
||||
</select> ".LAN_MAILOUT_47." </td>
|
||||
<td style='width:65%' class='forumheader3'>
|
||||
<input type='text' name='user_search_value' class='tbox' style='width:80%' value='' />
|
||||
</td></tr>
|
||||
";
|
||||
|
||||
|
||||
|
||||
// Extended user fields
|
||||
$ret .= "
|
||||
<tr><td class='forumheader3'>".LAN_MAILOUT_46.ret_extended_field_list('extended_1_name', TRUE).LAN_MAILOUT_48." </td>
|
||||
<td class='forumheader3'>
|
||||
<input type='text' name='extended_1_value' class='tbox' style='width:80%' value='' />
|
||||
</td></tr>
|
||||
<tr><td class='forumheader3'>".LAN_MAILOUT_46.ret_extended_field_list('extended_2_name', TRUE).LAN_MAILOUT_48." </td>
|
||||
<td class='forumheader3'>
|
||||
<input type='text' name='extended_2_value' class='tbox' style='width:80%' value='' />
|
||||
</td></tr>
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(is_numeric($_POST['email_to']))
|
||||
// Called to show current selection criteria, and optionally allow edit
|
||||
//
|
||||
//
|
||||
/**
|
||||
* Called to show current selection criteria, and optionally allow edit
|
||||
*
|
||||
* @param $allow_edit is TRUE to allow user to change the selection; FALSE to just display current settings
|
||||
* @param $selectVals is the current selection information - in the same format as returned by returnSelectors()
|
||||
*
|
||||
* @return Returns HTML which is displayed in a table cell. Typically we return a complete table
|
||||
*/
|
||||
public function showSelect($allow_edit = FALSE, $selectVals = FALSE)
|
||||
{
|
||||
$sql->db_Select("userclass_classes", "userclass_name", "userclass_id = '{$_POST['email_to']}'");
|
||||
$row = $sql->db_Fetch();
|
||||
$_to = LAN_MAILOUT_23.$row['userclass_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_to = $_POST['email_to'];
|
||||
}
|
||||
$ret .= "<tr>
|
||||
<td class='forumheader3' style='width:30%'>".LAN_MAILOUT_03."</td>
|
||||
<td class='forumheader3'>".$_to." ";
|
||||
if($_POST['email_to'] == "self"){
|
||||
$ret = "<table style='width:95%'>";
|
||||
|
||||
if ($allow_edit)
|
||||
{
|
||||
// User class select
|
||||
$ret .= "<tr>
|
||||
<td class='forumheader3'>".LAN_MAILOUT_03.": </td>
|
||||
<td class='forumheader3'>
|
||||
".$this->adminHandler->userClassesTotals('email_to', varset($selectVals['email_to'], ''))."</td>
|
||||
</tr>";
|
||||
|
||||
// User Search Field.
|
||||
$u_array = array('user_name'=>LAN_MAILOUT_43,'user_login'=>LAN_MAILOUT_44,'user_email'=>LAN_MAILOUT_45);
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td style='width:35%' class='forumheader3'>".LAN_MAILOUT_46."
|
||||
<select name='user_search_name' class='tbox'>
|
||||
<option value=''> </option>";
|
||||
|
||||
foreach ($u_array as $key=>$val)
|
||||
{
|
||||
$selected = '';
|
||||
if (isset($selectVals['user_search_name']) && ($selectVals['user_search_name'] == $v)) { $selected = " selected='selected'"; }
|
||||
$ret .= "<option value='{$key}' >".$val."</option>\n";
|
||||
}
|
||||
$ret .= "
|
||||
</select> ".LAN_MAILOUT_47." </td>
|
||||
<td style='width:65%' class='forumheader3'>
|
||||
<input type='text' name='user_search_value' class='tbox' style='width:80%' value='".varset($selectVals['user_search_value'])."' />
|
||||
</td></tr>
|
||||
";
|
||||
|
||||
// User last visit
|
||||
$ret .= "
|
||||
<tr><td class='forumheader3'>".LAN_MAILOUT_56.' '.$this->adminHandler->comparisonSelect('last_visit_match', $selectVals['last_visit_match'])." </td>
|
||||
<td class='forumheader3'>
|
||||
<input type='text' name='last_visit_date' class='tbox' style='width:30%' value='".varset($selectVals['last_visit_date'], '')."' />
|
||||
</td></tr>";
|
||||
|
||||
|
||||
// Extended user fields
|
||||
$ret .= "
|
||||
<tr><td class='forumheader3'>".LAN_MAILOUT_46.$this->adminHandler->ret_extended_field_list('extended_1_name', varset($selectVals['extended_1_name'], ''), TRUE).LAN_MAILOUT_48." </td>
|
||||
<td class='forumheader3'>
|
||||
<input type='text' name='extended_1_value' class='tbox' style='width:80%' value='".varset($selectVals['extended_1_value'], '')."' />
|
||||
</td></tr>
|
||||
<tr><td class='forumheader3'>".LAN_MAILOUT_46.$this->adminHandler->ret_extended_field_list('extended_2_name', varset($selectVals['extended_2_name'], ''), TRUE).LAN_MAILOUT_48." </td>
|
||||
<td class='forumheader3'>
|
||||
<input type='text' name='extended_2_value' class='tbox' style='width:80%' value='".varset($selectVals['extended_2_value'], '')."' />
|
||||
</td></tr>
|
||||
";
|
||||
}
|
||||
else
|
||||
{ // Display existing values
|
||||
if(is_numeric($selectVals['email_to']))
|
||||
{
|
||||
$this->e107->sql->db_Select('userclass_classes', 'userclass_name', "userclass_id = ".intval($selectVals['email_to']));
|
||||
$row = $this->e107->sql->db_Fetch();
|
||||
$_to = LAN_MAILOUT_23.$row['userclass_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_to = $selectVals['email_to'];
|
||||
}
|
||||
$ret .= "<tr>
|
||||
<td class='forumheader3'>".LAN_MAILOUT_03."</td>
|
||||
<td class='forumheader3'>".$_to." ";
|
||||
if($selectVals['email_to'] == "self")
|
||||
{
|
||||
$text .= "<".USEREMAIL.">";
|
||||
}
|
||||
$ret .= "</td></tr>";
|
||||
$ret .= "</td></tr>";
|
||||
|
||||
|
||||
if ($_POST['user_search_name'] && $_POST['user_search_value'])
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%'>".$_POST['user_search_name']."</td>
|
||||
<td class='forumheader3'>".$_POST['user_search_value']." </td>
|
||||
</tr>";
|
||||
}
|
||||
if (vartrue($selectVals['user_search_name']) && vartrue($selectVals['user_search_value']))
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3'>".$selectVals['user_search_name']."</td>
|
||||
<td class='forumheader3'>".varset($selectVals['user_search_value'])." </td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if ($_POST['extended_1_name'] && $_POST['extended_1_value'])
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%'>".$_POST['extended_1_name']."</td>
|
||||
<td class='forumheader3'>".$_POST['extended_1_value']." </td>
|
||||
</tr>";
|
||||
}
|
||||
if ($_POST['extended_2_name'] && $_POST['extended_2_value'])
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%'>".$_POST['extended_2_name']."</td>
|
||||
<td class='forumheader3'>".$_POST['extended_2_value']." </td>
|
||||
</tr>";
|
||||
}
|
||||
if (vartrue($selectVals['last_visit_match']) && vartrue($selectVals['last_visit_date']))
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3'>".LAN_MAILOUT_56."</td>
|
||||
<td class='forumheader3'>".$selectVals['last_visit_match'].' '.gmstrtotime("%D-%M-%Y",$selectVals['last_visit_date'])." </td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3'>".$selectVals['extended_1_name']."</td>
|
||||
<td class='forumheader3'>".$selectVals['extended_1_value']." </td>
|
||||
</tr>";
|
||||
}
|
||||
if (vartrue($selectVals['extended_2_name']) && vartrue($selectVals['extended_2_value']))
|
||||
{
|
||||
$ret .= "
|
||||
<tr>
|
||||
<td class='forumheader3'>".$selectVals['extended_2_name']."</td>
|
||||
<td class='forumheader3'>".$selectVals['extended_2_value']." </td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
return $ret.'</table>';
|
||||
}
|
||||
|
||||
|
||||
return $ret.'</table>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,25 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||
| $Revision: 1.114 $
|
||||
| $Date: 2009-11-08 13:21:56 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||
* $Revision: 1.115 $
|
||||
* $Date: 2009-11-15 17:38:05 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php");
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_plugin.php');
|
||||
|
||||
class e107plugin
|
||||
{
|
||||
@ -46,7 +45,8 @@ class e107plugin
|
||||
'e_userinfo',
|
||||
'e_tagwords',
|
||||
'e_url',
|
||||
'e_cron'
|
||||
'e_cron',
|
||||
'e_mailout'
|
||||
);
|
||||
|
||||
// List of all plugin variables which need to be checked - install required if one or more set and non-empty
|
||||
|
@ -11,15 +11,17 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/help/mailout.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2008-01-02 20:14:13 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-11-15 17:38:05 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'makemail';
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$action = $e107->tp->toDB(varset($_GET['mode'],'makemail'));
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
@ -27,22 +29,31 @@ if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'makemai
|
||||
$text = 'Send mail with constraints specified by an optional plugin';
|
||||
break;
|
||||
case 'debug' :
|
||||
$text = 'For devs only. A second query parameter matches the gen_type field in the \'generic\' table. Ignore the column headings';
|
||||
$text = 'For devs only. Not used at present';
|
||||
break;
|
||||
case 'list' :
|
||||
case 'saved' :
|
||||
$text = 'Select and use a saved email template to send a mailshot. Delete any template no longer required';
|
||||
break;
|
||||
case 'mailouts' :
|
||||
$text = 'List of stored mailshots. Allows you to see whether they have been sent, and re-send any emails which failed.<br />';
|
||||
$text .= 'You can also view some detail of the email, including the error reason for some of those that failed.<br />';
|
||||
$text .= 'To retry outstanding emails, click on the \'resend\' icon. Then click on \'Proceed\', which will open a progress window.';
|
||||
$text .= ' To abort a mailshot, click on the \'Cancel\' button in the main screen.';
|
||||
case 'pending' :
|
||||
$text = 'List of mailshots released for sending, together with current status.';
|
||||
break;
|
||||
case 'held' :
|
||||
$text = 'List of emails which have been prepared for sending, but not yet released';
|
||||
break;
|
||||
case 'sent' :
|
||||
$text = 'List of completed mailshots. Allows you to see the sending results.<br />';
|
||||
break;
|
||||
case 'savedmail' :
|
||||
case 'makemail' :
|
||||
$text = 'Create an email, and select the list of recipients. You can save the email text as a template for later, or send immediately.<br />';
|
||||
$text .= 'Any attachment is selected from the list of valid downloads.';
|
||||
$text = 'Create an email, give it a meaningful title, and select the list of recipients. You can save everything as a template for later, or send immediately.<br />';
|
||||
$text .= 'Email addresses may be contributed by plugins (such as newsletter), and duplicates are removed when the mail is sent<br />';
|
||||
$text .= 'Any attachment is selected from the list of valid downloads.<br />';
|
||||
$text .= 'Mail may be sent as plain text (most universal, and least at risk of being classed as spam), or as HTML (in which case a plain text alternative is automatically generated). The theme style
|
||||
may optionally be added to the email';
|
||||
break;
|
||||
case 'recipients' :
|
||||
$text = 'Shows all recipients or potential recipients of an email, together with current status';
|
||||
break;
|
||||
case 'prefs' :
|
||||
$text = '<b>Configure mailshot options.</b><br />
|
||||
A test email is sent using the current method and settings.<br /><br />';
|
||||
@ -54,13 +65,16 @@ if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'makemai
|
||||
$text .= '<b>Email Address Sources</b><br />
|
||||
If you have additional mail-related plugins, you can select which of them may contribute email addresses to the list.<br /><br />';
|
||||
$text .= '<b>Logging</b><br />
|
||||
The logging option creates a text file in the stats plugin\'s log directory. This must be deleted periodically. The \'logging
|
||||
The logging option creates a text file in the system log directory. This must be deleted periodically. The \'logging
|
||||
only\' options allow you to see exactly who would receive emails if actually sent. The \'with errors\' option fails every
|
||||
7th email, primarily for testing';
|
||||
break;
|
||||
case 'maint' :
|
||||
$text = 'Maintenance functions for the mail database';
|
||||
break;
|
||||
default :
|
||||
$text = 'Undocumented option';
|
||||
}
|
||||
|
||||
$ns -> tablerender("Mail Help", $text);
|
||||
$ns -> tablerender('Mail Help', $text);
|
||||
?>
|
@ -1,13 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-09-01 19:53:08 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2009-11-15 17:38:05 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
define('LAN_MAILOUT_01','From Name');
|
||||
define('LAN_MAILOUT_02','From Email');
|
||||
@ -17,17 +22,17 @@ define('LAN_MAILOUT_05','Bcc');
|
||||
define('LAN_MAILOUT_06','Subject');
|
||||
define('LAN_MAILOUT_07','Attachment');
|
||||
define('LAN_MAILOUT_08','Send Email');
|
||||
define('LAN_MAILOUT_09','Use Theme Style');
|
||||
define('LAN_MAILOUT_09','Send format');
|
||||
define('LAN_MAILOUT_10','User Subscribed');
|
||||
define('LAN_MAILOUT_11','Insert Variables');
|
||||
define('LAN_MAILOUT_12','All Members');
|
||||
define('LAN_MAILOUT_13','All Unverified Members ');
|
||||
//define("MAILAN_14","It is recommended that you enable SMTP for sending large numbers of emails - set in preferences below.");
|
||||
define('LAN_MAILOUT_15','Mail-Out');
|
||||
define('LAN_MAILOUT_14','Display Name');
|
||||
define('LAN_MAILOUT_15','Mailout');
|
||||
define('LAN_MAILOUT_16','username');
|
||||
define('LAN_MAILOUT_17','signup link');
|
||||
define('LAN_MAILOUT_18','user id');
|
||||
define('LAN_MAILOUT_19','There is no email address for site-admin. Please check your preferences and try again.');
|
||||
define('LAN_MAILOUT_19','No target email address specified');
|
||||
define('LAN_MAILOUT_20','Sendmail-path');
|
||||
define('LAN_MAILOUT_21','Bulk mailing Entries');
|
||||
define('LAN_MAILOUT_22','There are currently no saved entries');
|
||||
@ -38,7 +43,7 @@ define('LAN_MAILOUT_26', 'Pause bulk mailing every');
|
||||
define('LAN_MAILOUT_27', 'emails for ');
|
||||
define('LAN_MAILOUT_28', 'Save Changes');
|
||||
define('LAN_MAILOUT_29', 'seconds');
|
||||
define('LAN_MAILOUT_30', 'More than 30 seconds may cause the browser to time-out');
|
||||
define('LAN_MAILOUT_30', 'Used mostly with SMTP keepalive. A pause of more than 30 seconds may cause the browser to time-out');
|
||||
define('LAN_MAILOUT_31', 'Bounced Email Processing');
|
||||
define('LAN_MAILOUT_32', 'Email address');
|
||||
define('LAN_MAILOUT_33', 'Incoming Mail server');
|
||||
@ -64,17 +69,17 @@ define('LAN_MAILOUT_52', 'Last mod');
|
||||
define('LAN_MAILOUT_53', 'Admins');
|
||||
define('LAN_MAILOUT_54', 'Self');
|
||||
define('LAN_MAILOUT_55', 'Userclass');
|
||||
define('LAN_MAILOUT_56','Send Mail');
|
||||
define('LAN_MAILOUT_57','Send bulk SMTP emails in blocks'); // SMTP KeepAlive option
|
||||
define('LAN_MAILOUT_58', 'There is a problem with the attachment:');
|
||||
define('LAN_MAILOUT_59', 'Mailing Progress');
|
||||
define('LAN_MAILOUT_60', 'Sending...');
|
||||
define('LAN_MAILOUT_61', 'There are no remaining emails to be sent.');
|
||||
define('LAN_MAILOUT_62', 'Emails sent:');
|
||||
define('LAN_MAILOUT_63', 'Emails failed:');
|
||||
define('LAN_MAILOUT_64', 'Total time elapsed:');
|
||||
define('LAN_MAILOUT_65', 'seconds');
|
||||
define('LAN_MAILOUT_66', 'Cancelled Successfully');
|
||||
define('LAN_MAILOUT_56', 'Last Visit (dd-mm-yy)');
|
||||
define('LAN_MAILOUT_57', 'Send bulk SMTP emails in blocks'); // SMTP KeepAlive option
|
||||
//define('LAN_MAILOUT_58', 'There is a problem with the attachment:');
|
||||
//define('LAN_MAILOUT_59', 'Mailing Progress');
|
||||
//define('LAN_MAILOUT_60', 'Sending...');
|
||||
//define('LAN_MAILOUT_61', 'There are no remaining emails to be sent.');
|
||||
//define('LAN_MAILOUT_62', 'Emails sent:');
|
||||
//define('LAN_MAILOUT_63', 'Emails failed:');
|
||||
//define('LAN_MAILOUT_64', 'Total time elapsed:');
|
||||
//define('LAN_MAILOUT_65', 'seconds');
|
||||
//define('LAN_MAILOUT_66', 'Cancelled Successfully');
|
||||
define('LAN_MAILOUT_67', 'The email could not be sent. Please review your SMTP settings, or select another mailing method and try again.');
|
||||
define('LAN_MAILOUT_68','Include from registered users');
|
||||
define('LAN_MAILOUT_69','matches, after ');
|
||||
@ -90,8 +95,8 @@ define('LAN_MAILOUT_78','Mailshot Status');
|
||||
define('LAN_MAILOUT_79','No mailshots to display');
|
||||
define('LAN_MAILOUT_80','Date');
|
||||
define('LAN_MAILOUT_81','The email has been successfully sent, please check your inbox.');
|
||||
define('LAN_MAILOUT_82','Original count');
|
||||
define('LAN_MAILOUT_83','Left to go');
|
||||
define('LAN_MAILOUT_82','Mails sent');
|
||||
define('LAN_MAILOUT_83','Mails to go');
|
||||
define('LAN_MAILOUT_84','Mail ID');
|
||||
define('LAN_MAILOUT_85','Originator');
|
||||
define('LAN_MAILOUT_86','Re-send');
|
||||
@ -105,7 +110,7 @@ define('LAN_MAILOUT_93','TLS');
|
||||
define('LAN_MAILOUT_94','(Use SSL for gmail/googlemail)');
|
||||
define('LAN_MAILOUT_95','Use VERP for bulk mailing');
|
||||
define('LAN_MAILOUT_96','none');
|
||||
define('LAN_MAILOUT_97','Saved emails');
|
||||
define('LAN_MAILOUT_97','Mailer Results');
|
||||
define('LAN_MAILOUT_98','Orphaned entries');
|
||||
define('LAN_MAILOUT_99','Confirm retry mailshot');
|
||||
define('LAN_MAILOUT_100','Message');
|
||||
@ -119,7 +124,7 @@ define('LAN_MAILOUT_107','at');
|
||||
define('LAN_MAILOUT_108','Result');
|
||||
define('LAN_MAILOUT_109','Show detail');
|
||||
define('LAN_MAILOUT_110','Send test email');
|
||||
//define('LAN_MAILOUT_111','Clicking button will send test email to main admin email address');
|
||||
define('LAN_MAILOUT_111','Email Title (not sent)');
|
||||
define('LAN_MAILOUT_112','Click to send email to');
|
||||
define('LAN_MAILOUT_113','Test email from');
|
||||
define('LAN_MAILOUT_114',"This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
|
||||
@ -133,8 +138,121 @@ define('LAN_MAILOUT_121','Standard POP3');
|
||||
define('LAN_MAILOUT_122','POP3, TLS disabled');
|
||||
define('LAN_MAILOUT_123','POP3 with TLS');
|
||||
define('LAN_MAILOUT_124','IMAP');
|
||||
define('LAN_MAILOUT_125', 'Test address');
|
||||
define('LAN_MAILOUT_125', 'Text only');
|
||||
define('LAN_MAILOUT_126', 'Text and HTML');
|
||||
define('LAN_MAILOUT_127', 'Include theme');
|
||||
define('LAN_MAILOUT_128', 'Send Error');
|
||||
define('LAN_MAILOUT_129', 'Expiry Date');
|
||||
define('LAN_MAILOUT_130', 'Creation Date');
|
||||
define('LAN_MAILOUT_131', 'Sending Started');
|
||||
define('LAN_MAILOUT_132', 'Sending Complete');
|
||||
define('LAN_MAILOUT_133', 'Source');
|
||||
define('LAN_MAILOUT_134', 'Priority');
|
||||
define('LAN_MAILOUT_135', 'Title');
|
||||
define('LAN_MAILOUT_136', 'Mailout Status');
|
||||
define('LAN_MAILOUT_137', 'Mail Ref');
|
||||
define('LAN_MAILOUT_138', 'Email status');
|
||||
define('LAN_MAILOUT_139', 'Date active');
|
||||
define('LAN_MAILOUT_140', 'Recipient Email');
|
||||
define('LAN_MAILOUT_141', 'Recipient Name');
|
||||
define('LAN_MAILOUT_142', 'Recipient User ID');
|
||||
define('LAN_MAILOUT_143', 'Email ref.');
|
||||
define('LAN_MAILOUT_144', 'Bounced');
|
||||
define('LAN_MAILOUT_145', 'New email saved');
|
||||
define('LAN_MAILOUT_146', 'Error saving email');
|
||||
define('LAN_MAILOUT_147', 'Email updated');
|
||||
define('LAN_MAILOUT_148', 'User values');
|
||||
define('LAN_MAILOUT_149', 'Sender Email');
|
||||
define('LAN_MAILOUT_150', 'Sender Name');
|
||||
define('LAN_MAILOUT_151', 'Copy to');
|
||||
define('LAN_MAILOUT_152', 'Blind copy to');
|
||||
define('LAN_MAILOUT_153', 'Attachments');
|
||||
define('LAN_MAILOUT_154', 'Send Format');
|
||||
define('LAN_MAILOUT_155', 'Selectors');
|
||||
define('LAN_MAILOUT_156', 'Maximum number of emails to send per cron tick');
|
||||
define('LAN_MAILOUT_157', 'Value will depend on a number of factors, including how often your mail queue cron job is triggered and the rate at which your ISP will accept outgoing mail. Zero to clear queue each time');
|
||||
define('LAN_MAILOUT_158', 'Send now');
|
||||
define('LAN_MAILOUT_159', 'Hold email');
|
||||
define('LAN_MAILOUT_160', 'Cancel send');
|
||||
define('LAN_MAILOUT_161', 'IMPORTANT! This file appears to not exist');
|
||||
define('LAN_MAILOUT_162', 'IMPORTANT! You need to make this file executable');
|
||||
define('LAN_MAILOUT_163', 'Edit/Send Mail');
|
||||
define('LAN_MAILOUT_164', 'Email information not found');
|
||||
define('LAN_MAILOUT_165', 'Confirm delete the following stored email, including any recipient records');
|
||||
define('LAN_MAILOUT_166', 'General error deleting mail ref: --ID--');
|
||||
define('LAN_MAILOUT_167', 'Error deleting mail content ref: --ID--');
|
||||
define('LAN_MAILOUT_168', 'Mail content deleted ref: --ID--');
|
||||
define('LAN_MAILOUT_169', 'Error deleting mail recipients ref: --ID--');
|
||||
define('LAN_MAILOUT_170', 'Deleted --NUM-- recipients for mail ref: --ID--');
|
||||
define('LAN_MAILOUT_171', 'Confirm email delete');
|
||||
define('LAN_MAILOUT_172', 'Mail Type/Status');
|
||||
define('LAN_MAILOUT_173', 'Recipients');
|
||||
define('LAN_MAILOUT_174', 'Security check fail: --ID-- --CHECK--');
|
||||
define('LAN_MAILOUT_175', 'Before');
|
||||
define('LAN_MAILOUT_176', 'Equal to');
|
||||
define('LAN_MAILOUT_177', 'After');
|
||||
define('LAN_MAILOUT_178', 'Last site visit');
|
||||
define('LAN_MAILOUT_179', 'Confirm email send');
|
||||
define('LAN_MAILOUT_180', 'Selection criteria:');
|
||||
define('LAN_MAILOUT_181', 'Show recipients');
|
||||
define('LAN_MAILOUT_182', 'Tidy database tables');
|
||||
define('LAN_MAILOUT_183', 'Error tidying database');
|
||||
define('LAN_MAILOUT_184', 'Database tidied');
|
||||
define('LAN_MAILOUT_185', 'Emails added to send queue');
|
||||
define('LAN_MAILOUT_186', 'General error putting mail ref: --ID-- on hold');
|
||||
define('LAN_MAILOUT_187', 'Email --ID-- put on hold');
|
||||
define('LAN_MAILOUT_188', 'General error sending mail ref: --ID--');
|
||||
define('LAN_MAILOUT_189', 'Test address');
|
||||
|
||||
// Admin menu text
|
||||
define('LAN_MAILOUT_190', 'Create/Send Mail');
|
||||
define('LAN_MAILOUT_191', 'Saved emails');
|
||||
define('LAN_MAILOUT_192', 'Completed Mailshots');
|
||||
define('LAN_MAILOUT_193', 'Pending Mailshots');
|
||||
define('LAN_MAILOUT_194', 'Held Mailshots');
|
||||
define('LAN_MAILOUT_195', '');
|
||||
define('LAN_MAILOUT_196', '');
|
||||
|
||||
// Block of error messages kept together
|
||||
define('LAN_MAILOUT_200', 'No subject specified');
|
||||
define('LAN_MAILOUT_201', 'No meaningful data for email');
|
||||
define('LAN_MAILOUT_202', 'No text in email body');
|
||||
define('LAN_MAILOUT_203', 'No sender name specified');
|
||||
define('LAN_MAILOUT_204', 'No sender email address specified');
|
||||
define('LAN_MAILOUT_205', 'Email send format error');
|
||||
define('LAN_MAILOUT_206', 'Invalid mail ID (--ID--) specified');
|
||||
define('LAN_MAILOUT_207', '');
|
||||
define('LAN_MAILOUT_208', '');
|
||||
define('LAN_MAILOUT_209', '');
|
||||
define('LAN_MAILOUT_210', '');
|
||||
|
||||
// Block of status messages kept together
|
||||
define('LAN_MAILOUT_211', 'Sent');
|
||||
define('LAN_MAILOUT_212', 'Failed');
|
||||
define('LAN_MAILOUT_213', 'Bounced');
|
||||
define('LAN_MAILOUT_214', 'To send');
|
||||
define('LAN_MAILOUT_215', 'Saved');
|
||||
define('LAN_MAILOUT_216', 'Code error');
|
||||
define('LAN_MAILOUT_217', 'Held');
|
||||
define('LAN_MAILOUT_218', 'Cancelled');
|
||||
define('LAN_MAILOUT_219', '');
|
||||
|
||||
// General messages continued
|
||||
define('LAN_MAILOUT_220', 'Email ID --ID-- cancelled');
|
||||
define('LAN_MAILOUT_221', 'Error cancelling email with ID --ID--');
|
||||
define('LAN_MAILOUT_222', 'Default email format');
|
||||
define('LAN_MAILOUT_223', '(Used for some non-bulk emails)');
|
||||
define('LAN_MAILOUT_224', '');
|
||||
define('LAN_MAILOUT_225', '');
|
||||
define('LAN_MAILOUT_226', '');
|
||||
define('LAN_MAILOUT_227', '');
|
||||
define('LAN_MAILOUT_228', '');
|
||||
define('LAN_MAILOUT_229', '');
|
||||
define('LAN_MAILOUT_230', '');
|
||||
|
||||
|
||||
define('LAN_SEND', 'Send');
|
||||
define('LAN_HOLD', 'Hold');
|
||||
define('LAN_SUBMIT', 'Do it!');
|
||||
|
||||
?>
|
23
e107_plugins/calendar_menu/languages/English_mailer.php
Normal file
23
e107_plugins/calendar_menu/languages/English_mailer.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English_mailer.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-11-15 17:38:05 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
define('LAN_EC_MAIL_01', 'Event calendar subscribers list');
|
||||
define('LAN_EC_MAIL_02', 'No categories defined, or database error');
|
||||
define('LAN_EC_MAIL_03', 'Category: ');
|
||||
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user