\MassMailbot

the mailbot that sends messages for newsletters, etc.

..

Summary

Methods
Properties
Constants
__construct()
run()
No public properties found
No constants found
queryDB()
getSingleRow()
log()
sendEmail()
reportStats()
$count
N/A
_getMessageList()
_updateMessageStatus()
No private properties found
N/A

Properties

$count

$count

Methods

__construct()

__construct() : \nothing

constructor.

..

Returns

\nothing

run()

run() : \nothing

Actually run the bot

Returns

\nothing

queryDB()

queryDB(string $queryString) : object

an interface for all DB calls from mailbot

Parameters

string $queryString

the SQL query to execute

Returns

object —

the result from the DB call

getSingleRow()

getSingleRow(string $queryString) : object

a local replacement for LoadRow

Parameters

string $queryString

the SQL query to execute

Returns

object —

the first row returned by the query

log()

log(string $msg) : \nothing

log all mailbot(s) activities

Parameters

string $msg

the text to log

Returns

\nothing

sendEmail()

sendEmail(string $subject, string $from, string $to, string $title, string $body, string $language) : object

actually send out emails using a common BW template

Parameters

string $subject

the subject line for the message

string $from

the email address of the sender

string $to

the email address of the recipient

string $title

an optional title to show in the message (HTML H1 tag) (default: false)

string $body

the plaintext body of the message

string $language

the language code used in the message (default: 'en')

Returns

object —

the result from the MOD_mail::sendEmail call

reportStats()

reportStats() : \nothing

Log results for the bot execution

Returns

\nothing

_getMessageList()

_getMessageList() : object

get the list of messages to broadcast from the db

Returns

object —

the mySQL query result object

_updateMessageStatus()

_updateMessageStatus(int $id, string $status, int $receiver) : object

update message status in the DB

Parameters

int $id

the message id in the db

string $status

the status to set for the message

int $receiver

the id of the email recipient

Returns

object —

the result from the DB call