\MemberToMemberMailbot

the mailbot that sends private messages between members

Summary

Methods
Properties
Constants
__construct()
run()
No public properties found
No constants found
queryDB()
getSingleRow()
log()
sendEmail()
reportStats()
$count
N/A
_getMessageList()
_formatMessage()
_updateMessageStatus()
_calculateReplyAddress()
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 be sent from the database

Returns

object —

a mysql query object

_formatMessage()

_formatMessage(object $message) : string

return the formatted email content for $msg

Parameters

object $message

the msg object as returned by the SQL query

Returns

string —

the formatted email message body

_updateMessageStatus()

_updateMessageStatus(int $msgId, string $status, int $IdTriggerer) : \nothing

update the DB with new message statuses

Parameters

int $msgId

the id of the message for which to update the DB

string $status

the status to set for the message

int $IdTriggerer

the user id of the user running the bot (default to 0)

Returns

\nothing

_calculateReplyAddress()

_calculateReplyAddress()