class messenger

Messenger

Properties

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

Methods

__construct($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

void
anti_abuse_headers(config $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)

No description

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

setup_template()

Setup template engine

set_template_paths($path_name, $paths)

Set template paths to load

Details

at line 40
__construct($use_queue = true)

Constructor

Parameters

$use_queue

at line 51
reset()

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

at line 63
set_addresses(array $user)

Set addresses for to/im as available

Parameters

array $user

User row

at line 79
to($address, $realname = '')

Sets an email address to send to

Parameters

$address
$realname

at line 106
cc($address, $realname = '')

Sets an cc address to send to

Parameters

$address
$realname

at line 121
bcc($address, $realname = '')

Sets an bcc address to send to

Parameters

$address
$realname

at line 136
im($address, $realname = '')

Sets a im contact to send to

Parameters

$address
$realname

at line 152
replyto($address)

Set the reply to address

Parameters

$address

at line 160
from($address)

Set the from address

Parameters

$address

at line 168
subject($subject = '')

set up subject for mail

Parameters

$subject

at line 176
headers($headers)

set up extra mail headers

Parameters

$headers

at line 188
void anti_abuse_headers(config $config, user $user)

Adds X-AntiAbuse headers

Parameters

config $config

Config object

user $user

User object

Return Value

void

at line 199
set_mail_priority($priority = MAIL_NORMAL_PRIORITY)

Set the email priority

Parameters

$priority

at line 207
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
assign_vars($vars)

assign variables to email template

Parameters

$vars

at line 300
assign_block_vars($blockname, $vars)

No description

Parameters

$blockname
$vars

at line 316
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 NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH

bool $break

Flag indicating if the function only formats the subject and the message without sending it

Return Value

bool

at line 420
error($type, $msg)

Add error message to log

Parameters

$type
$msg

at line 450
save_queue()

Save to queue

at line 466
string generate_message_id()

Generates a valid message id to be used in emails

Return Value

string

message id

at line 478
build_header($to, $cc, $bcc)

Return email header

Parameters

$to
$cc
$bcc

at line 533
msg_email()

Send out emails

at line 658
msg_jabber()

Send jabber message out

at line 730
protected setup_template()

Setup template engine

at line 766
protected set_template_paths($path_name, $paths)

Set template paths to load

Parameters

$path_name
$paths