phpBB API Documentation
Class

messenger

class messenger

Messenger

Properties

$msg
$extra_headers
$replyto
$from
$subject
$addresses
$mail_priority
$use_queue

Methods

messenger($use_queue = true)

Constructor

reset()

Resets all the data (address, template file, etc etc) to default

set_addresses(array $user)

Set addresses for to/im as available

to($address, $realname = '')

Sets an email address to send to

cc($address, $realname = '')

Sets an cc address to send to

bcc($address, $realname = '')

Sets an bcc address to send to

im($address, $realname = '')

Sets a im contact to send to

replyto($address)

Set the reply to address

from($address)

Set the from address

subject($subject = '')

set up subject for mail

headers($headers)

set up extra mail headers

null anti_abuse_headers(array $config, user $user)

Adds X-AntiAbuse headers

set_mail_priority($priority = MAIL_NORMAL_PRIORITY)

Set the email priority

template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '')

Set email template to use

assign_vars($vars)

assign variables to email template

assign_block_vars($blockname, $vars)

bool send(int $method = NOTIFY_EMAIL, bool $break = false)

Send the mail out to the recipients set previously in var $this->addresses

error($type, $msg)

Add error message to log

save_queue()

Save to queue

string generate_message_id()

Generates a valid message id to be used in emails

build_header($to, $cc, $bcc)

Return email header

msg_email()

Send out emails

msg_jabber()

Send jabber message out

Details

at line 39
public messenger($use_queue = true)

Constructor

Parameters

$use_queue

at line 50
public reset()

Resets all the data (address, template file, etc etc) to default

at line 62
public set_addresses(array $user)

Set addresses for to/im as available

Parameters

array $user User row

at line 78
public to($address, $realname = '')

Sets an email address to send to

Parameters

$address
$realname

at line 105
public cc($address, $realname = '')

Sets an cc address to send to

Parameters

$address
$realname

at line 120
public bcc($address, $realname = '')

Sets an bcc address to send to

Parameters

$address
$realname

at line 135
public im($address, $realname = '')

Sets a im contact to send to

Parameters

$address
$realname

at line 151
public replyto($address)

Set the reply to address

Parameters

$address

at line 159
public from($address)

Set the from address

Parameters

$address

at line 167
public subject($subject = '')

set up subject for mail

Parameters

$subject

at line 175
public headers($headers)

set up extra mail headers

Parameters

$headers

at line 188
public null anti_abuse_headers(array $config, user $user)

Adds X-AntiAbuse headers

Parameters

array $config Configuration array
user $user A user object

Return Value

null

at line 199
public set_mail_priority($priority = MAIL_NORMAL_PRIORITY)

Set the email priority

Parameters

$priority

at line 207
public template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '')

Set email template to use

Parameters

$template_file
$template_lang
$template_path
$template_dir_prefix

at line 293
public assign_vars($vars)

assign variables to email template

Parameters

$vars

at line 300
public assign_block_vars($blockname, $vars)

Parameters

$blockname
$vars

at line 316
public bool send(int $method = NOTIFY_EMAIL, bool $break = false)

Send the mail out to the recipients set previously in var $this->addresses

Parameters

int $method User notification method NOTIFYEMAIL|NOTIFYIM|NOTIFY_BOTH
bool $break Flag indicating if the function only formats the subject and the message without sending it

Return Value

bool

at line 404
public error($type, $msg)

Add error message to log

Parameters

$type
$msg

at line 434
public save_queue()

Save to queue

at line 450
public string generate_message_id()

Generates a valid message id to be used in emails

Return Value

string message id

at line 462
public build_header($to, $cc, $bcc)

Return email header

Parameters

$to
$cc
$bcc

at line 517
public msg_email()

Send out emails

at line 615
public msg_jabber()

Send jabber message out