KWeb  6.4
KMailQueue Class Reference

Public Member Functions

 markEmailsForCron (array $options)
 resetFailed (array $options)
 removeMail (array $options)
 runQueue (array $options, $limit, $test, $sendFailed=false, $overrideTo=false)
 Sends emails in Queue datatable.
 addMail (KDB_Driver $db, $queue, $requestId, $emailFrom, $emailTo, $title, $plain, $html, $headers=null, $attachments=null, $lang=null, $allowCron=true, $priority=0, $sendAfter=null, $sendBefore=null)
 Adds email to the queue.

Static Public Member Functions

static instance ($create=true)
static runCron ($limit, $sendFailed=false, array $options=array())
static runCleanup ($mailExpireDays=true)

Data Fields

const OPT_QUEUE = "queue"
const OPT_REQUEST = "request"
const OPT_CRONALLOWED = "cron"
const OPT_TIMELIMIT = "timelimit"
const OPT_WITH_EMAILTO = "with_email_to"

Static Public Attributes

static $inst = null

Protected Member Functions

 __construct ()
 buildSqlWhereFromOptions ($options)
 createMailSender ()

Constructor & Destructor Documentation

KMailQueue::__construct ( ) [protected]

Member Function Documentation

KMailQueue::addMail ( KDB_Driver $  db,
$  queue,
$  requestId,
$  emailFrom,
$  emailTo,
$  title,
$  plain,
$  html,
$  headers = null,
$  attachments = null,
$  lang = null,
$  allowCron = true,
$  priority = 0,
$  sendAfter = null,
$  sendBefore = null 
)

Adds email to the queue.

Parameters:
$queueQueue identifier
$requestIdRequest identifier (queue specific)
$emailFrom
$emailTo
$title
$plainPlain text body (optional)
$htmlHTML body (optional)
$headersAdditional headers as Name: Value\n
$attachmentsSerialized information about attachmetns. See KMail
$langLanguage identifier of the email
$allowCronAllow to send this email automatically
$priorityPriority of the email in queue. Emails are sent in descending order
$sendBeforeUnix time after which the email is invalidated
$sendAfterUnix time after which the email will be sent
KMailQueue::buildSqlWhereFromOptions ( $  options) [protected]
KMailQueue::createMailSender ( ) [protected]
static KMailQueue::instance ( $  create = true) [static]
Returns:
KMailQueue
KMailQueue::markEmailsForCron ( array $  options)
KMailQueue::removeMail ( array $  options)
KMailQueue::resetFailed ( array $  options)
static KMailQueue::runCleanup ( $  mailExpireDays = true) [static]
static KMailQueue::runCron ( $  limit,
$  sendFailed = false,
array $  options = array() 
) [static]
KMailQueue::runQueue ( array $  options,
$  limit,
$  test,
$  sendFailed = false,
$  overrideTo = false 
)

Sends emails in Queue datatable.

Parameters:
$dbDatabase connection
$options
$limitMaximum emails sent in one batch
$testif TRUE email won't be marked as sent in the database
$sendFailedif TRUE will try to resend previously failed emails
$overrideTorecipient email address will be overriden by this setting

Field Documentation

KMailQueue::$inst = null [static]
const KMailQueue::OPT_QUEUE = "queue"
const KMailQueue::OPT_REQUEST = "request"
const KMailQueue::OPT_TIMELIMIT = "timelimit"
const KMailQueue::OPT_WITH_EMAILTO = "with_email_to"

The documentation for this class was generated from the following file: