\apex\app\msgemailer

Handles sending and formatting of individual e-mail messages through the configured SMTP servers on the system

Summary

Methods
Properties
Constants
get_smtp_server()
write()
dispatch()
dispatch_smtp()
process_emails()
send()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
connect()
dispatch_phpmail()
queue_mail()
$server_num
$smtp_connections
$app
$headers
$smtp_host
N/A

Properties

$server_num

$server_num :

Type

$smtp_connections

$smtp_connections :

Type

$headers

$headers :

Type

$smtp_host

$smtp_host :

Type

Methods

get_smtp_server()

get_smtp_server()

Get the next SMTP server to send from

write()

write(mixed  $sock,string  $message): string

Write line to a SMTP connection, and return the next line given by the SMTP server.

Parameters

mixed $sock

The SMTP socket connection

string $message

The message to send to the SMTP server

Returns

string —

The one-line response from the SMTP server

dispatch()

dispatch(\apex\app\msg\EventMessageInterface  $msg)

Send an e-mail message.

Parameters

\apex\app\msg\EventMessageInterface $msg

The e-mail message to send.

process_emails()

process_emails(string  $controller,integer  $userid,array  $condition = array(),array  $data = array())

Processes any necessary notifications. Takes in the type of notifications, and additional variables. Checks each notification against the condition, and sends any that match.

Parameters

string $controller

The notification controller / type alias of which to check.

integer $userid

The user ID# for which notifications are being processed against.

array $condition

Associative array containing details on the current request, and is checked against the condition notifications were created with.

array $data

Associatve array that is passed to the notification controller, and contains any additional information to retrieve merge variables (eg. transaction ID#, support ticket ID#, etc.)

send()

send(string  $to_email,string  $to_name,string  $from_email,string  $from_name,string  $subject,string  $message,string  $content_type = 'text/plain',string  $reply_to = '',string  $cc = '',string  $bcc = '',array  $attachments = array())

Send single e-mail message.

Send a single e-mail message vir rotating SMTP servers, or if not SMTP servers available via phpmail(). Dispatches the e-mail to a listener to take advantage of horizontal scaling with RabbitMQ.

Parameters

string $to_email

E-mail address of the recipient.

string $to_name

Full name of the recipient.

string $from_email

E-mail address of the sender.

string $from_name

Full name of the sender.

string $subject

The subject of the e-mail message.

string $message

The contents of the e-mail message to send.

string $content_type

Optional, and the content type of the e-mail message. Defaults to "text/plain".

string $reply_to

Optional, the the Reply-To e-mail address.

string $cc

Optional, and the e-mail address to CC the message to.

string $bcc

Optional, and the e-mail address to BCC the message to.

array $attachments

Optional, and associative array of file attachments to include, keys are the filename and value is contents of file.

connect()

connect(string  $host,integer  $port,string  $username,string  $password,integer  $is_ssl): mixed

Connect to a SMTP server.

Parameters

string $host

The SMTP host

integer $port

The SMTP port

string $username

The SMTP username

string $password

The SMTP password

integer $is_ssl

A 1/0 defining whether or not to use SSL connection

Returns

mixed —

The socket connection if successful, or false otherwise.

dispatch_phpmail()

dispatch_phpmail(\apex\app\interfaces\msg\EmailMessageInterface  $msg)

Send e-mail via php mail() function if not SMTP is available.

Parameters

\apex\app\interfaces\msg\EmailMessageInterface $msg

The e-mail message to send.

queue_mail()

queue_mail()

Queue undeliverable mail