App\Core_EmailQueue

Inherited from cmsApplication_List

Protected Attributes

protected $is_composed= false

Protected Methods

protected setEmailServerConfiguration()
Set SCHLIX default email server config. You can override this in your own derived class
protected booleansetupMailStorageFolderForEmailID(int $id)
create email storage folder if not exists

Public Methods

public __construct()
Constructor
public html2text($html, $advanced=false)
public sendEmailToUserByUserObject($user, $subject, $body_html, $body_text)
public booleansendEmailToUserByUserID(int $userid, string $subject, string $body_html, string $body_text)
Send an email to user by the user ID @global \App\Users $CurrentUser
public getEmailTemplate($virtual_filename)
public getEmailSubjectAndBodyFromTemplate($virtual_filename, $vars)
public typeprocessMessageTemplate(string $text, array $vars, bool $htmlencode=false)
Replaces variables (in format {$variablename} in text with variable values from $vars The regex has changed for Schlix v2
public booleangetDefaultSignature()
v2.2.4-1 and above uses master template (responsive email template) Deprecatedsince version 2.2.4-1 since version 2.2.4-1
public sendEmailFromWebMasterToUserByUserIDWithTemplateName($userid, $virtual_filename, $vars)
public sendEmailFromWebMasterWithTemplateName($field_to_name, $field_to_email, $virtual_filename, $vars)
public sendEmailWithTemplateName($field_from_name, $field_from_email, $field_to_name, $field_to_email, $field_cc_name, $field_cc_email, $field_replyto_name, $field_replyto_email, $virtual_filename, $vars)
public sendSimpleSignedEmailFromWebmaster(string $field_subject, string $field_to_name, string $field_to_email, string $body_html, string $body_text, array $attachments=NULL)
Send email with default sender
public sendSimpleSignedEmailToQueue(string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $body_html, string $body_text, array $attachments=NULL)
Send signed email Deprecatedsince version 2.2.4-1 since version 2.2.4-1
public sendSimpleEmailToQueue(string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $body_html, string $body_text, $attachments=NULL)
public sendSimpleEmailToQueueWithCC(string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $field_cc_name, string $field_cc_email, string $body_html, string $body_text, array $attachments=NULL)
public booleansendEmailToQueue(string $queue_marker, string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $field_cc_name, string $field_cc_email, string $field_replyto_name, string $field_replyto_email, string $field_bcc, string $field_priority, string $field_xmailer, string $field_return_receipt, string $body_html, string $body_text, string $attachments, string $extra_headers)
@global \SCHLIX\cmsDatabase $SystemDB
public processQueueByID($id)
public viewMainPage()
Frontend: view the main page.
public booleanRun(array $command)
Runs command. The main key 'action' in the command array is the router

Protected Static Methods

protected static markEmailQueueAsSentByID($id)
protected static markEmailQueueAsFailedByID($id, $error_msg='')
protected static processSingleQueue($queue)
protected static error($mail, $errormessage)

Public Static Methods

public static stringgetEmailStorageFolderForID(int $id, bool $is_relative=FALSE)
Get email storage folder
public static setDebug(bool $is_debug)
Set debug to true/false
public static getDebugString($str, $level)
public static __sendEmailDirectly($timeout, string $unique_id, string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $field_cc_name, string $field_cc_email, string $field_replyto_name, string $field_replyto_email, string $field_bcc, string $field_priority, string $extra_headers, string $field_xmailer, string $field_return_receipt, string $body_html, string $body_text, array $attachments)
Send email directly using PHPMailer. Don't set it to protected, it's a public method but users shouldn't access this method unless it's really critical so all emails are logged in the database Load Settings End load settings
public static getLastDebugOutput()
public static getCountOfEmailsSentWithinLastHour()
public static getListOfUnsentEMails($max_count)
public static intgetMaxEmailsPerHour()
Return the max email sent per hour
public static intgetMaxEmailsPerBatch()
Return the max email sent per batch
public static processRunEmailQueue()