|
Squiz Matrix
4.12.2
|
Public Member Functions | |
| __construct () | |
| start () | |
| fork () | |
| chunkJob ($job_id) | |
| processJob ($job_id) | |
| _reconnectDB ($dbsearch=FALSE) | |
| updateProgress ($progress_path, $user_id, $problematic, $filtered) | |
| nextChunk ($progress_path) | |
| getAllRecipients ($asset_to_send_id, $recipients) | |
| generateContent ($job_details, $job_path, $recipient_id=NULL, $email=NULL) | |
| calculateChunkSize ($thresholds, $progress_path) | |
| enforceSendRate ($thresholds, $progress_path) | |
| checkThreshold ($type, $thresholds, $extra='') | |
| isExcludedTime ($thresholds) | |
| checkTimeOut ($thresholds, $progress_info) | |
| _sigHandler ($signo) | |
| _errorHandler ($err_no, $err_msg, $err_file, $err_line) | |
Static Public Member Functions | |
| static | generateRawContent ($details) |
| static | replaceContentKeywords (&$content, &$user) |
Data Fields | |
| $error_log_file_name = 'bulkmail_errors' | |
Definition at line 32 of file bulk_mailer.inc.
| __construct | ( | ) |
Constructor
Definition at line 42 of file bulk_mailer.inc.
| _errorHandler | ( | $err_no, | |
| $err_msg, | |||
| $err_file, | |||
| $err_line | |||
| ) |
This function captures all errors and warnings that occur during the execution of start()
| int | $err_no | The type of error (E_*) |
| string | $err_msg | The error message |
| string | $err_file | The file the error occured in |
| string | $err_line | The line the error occured on |
Definition at line 1312 of file bulk_mailer.inc.
| _reconnectDB | ( | $dbsearch = FALSE | ) |
Reconnects to the DB as child process disconnects DB when it exits
Definition at line 640 of file bulk_mailer.inc.
| _sigHandler | ( | $signo | ) |
Signal handler for the pcntl fork process
| int | $signo | the signals that are supported by the PHP Process Control functions |
Definition at line 1286 of file bulk_mailer.inc.
| calculateChunkSize | ( | $thresholds, | |
| $progress_path | |||
| ) |
Calculate the recipient chunk size based on the 'send rate' threshold
| array | $thresholds | the threshold attribute of the post office |
| string | $progress_path | the progress path of the job |
Definition at line 1084 of file bulk_mailer.inc.
| checkThreshold | ( | $type, | |
| $thresholds, | |||
$extra = '' |
|||
| ) |
Checks a particular threshold rule
| string | $type | the type of the thresholding rule to check |
| array | $thresholds | the threshold attribute of the post office |
| array | $extra | extra param that needs to be passed in |
Definition at line 1182 of file bulk_mailer.inc.
| checkTimeOut | ( | $thresholds, | |
| $progress_info | |||
| ) |
Check if a running job is timeout-ed
| array | $thresholds | the threshold attribute of the post office |
| array | $progress_info | the current progress info from the progress file |
Definition at line 1261 of file bulk_mailer.inc.
| chunkJob | ( | $job_id | ) |
Cache recipients into chunks using a fork process
| int | $job_id | the unique id of the job entry |
Definition at line 160 of file bulk_mailer.inc.
| enforceSendRate | ( | $thresholds, | |
| $progress_path | |||
| ) |
Apply the send rate rule by putting the script to sleep after each recipient
| array | $thresholds | the threshold attribute of the post office |
| string | $progress_path | the progress path of the job |
Definition at line 1130 of file bulk_mailer.inc.
| fork | ( | ) |
| generateContent | ( | $job_details, | |
| $job_path, | |||
$recipient_id = NULL, |
|||
$email = NULL |
|||
| ) |
Generates the html bulkmail content based on the user and content generation type
Used in previewing mail and sending actual bmail (use each user or one user) Pre-selected user is used when we cannot login bulkmail_users
| array | $job_details | Details of the job |
| string | $job_path | path to the effective job data dir |
| int | $recipient_id | the recipient of this email, empty is for preview mail |
| array | the email of the recipient (or the email details), empty is for preview mail |
Definition at line 897 of file bulk_mailer.inc.
|
static |
Generate the raw content to be sent, ignoring user switching and recpient keyword replacement
| array | $details | The details of the job |
Definition at line 1012 of file bulk_mailer.inc.
| getAllRecipients | ( | $asset_to_send_id, | |
| $recipients | |||
| ) |
Cache all recipients (user_id => email) for a job
Warning: $result array can be huge Expands user_group to get all user/bulkmail_user Skips those recipients that is in .queue or .sent directory
| int | $asset_to_send_id | the id of the asset to send |
| array | $recipients | the job's 'recipients' attribute stripped from vars |
Definition at line 751 of file bulk_mailer.inc.
| isExcludedTime | ( | $thresholds | ) |
Check if current time is within excluded time threshold rule
| array | $thresholds | the threshold attribute of the post office |
Definition at line 1210 of file bulk_mailer.inc.
| nextChunk | ( | $progress_path | ) |
Proceed to next recipient chunk
| string | $progress_path | path to the progress info file |
Definition at line 709 of file bulk_mailer.inc.
| processJob | ( | $job_id | ) |
Process the active bulkmail job
| int | $job_id | the unique id of the job entry |
Definition at line 213 of file bulk_mailer.inc.
|
static |
Keyword replacement for customised email content of a user
| string | &$content | page content before keyword replacement |
| int | &$user | personalise content for this user |
Definition at line 1029 of file bulk_mailer.inc.
| start | ( | ) |
Starts the process, gets called from run.php
Definition at line 54 of file bulk_mailer.inc.
| updateProgress | ( | $progress_path, | |
| $user_id, | |||
| $problematic, | |||
| $filtered | |||
| ) |
Writes the progress info to a file after a mail has been added to the queue
If a user was both problematic AND filtered (probable if enabled), it will be marked as the former.
| string | $progress_path | path to the progress info file |
| int | $user_id | current recipient assetid |
| boolean | $problematic | TRUE means we couldn't generate bmail for this user |
| boolean | $filtered | TRUE means user's bmail was filtered out |
Definition at line 669 of file bulk_mailer.inc.