XOOPS RMCommon Utilities
2.1.8.91RC
|
Public Member Functions | |
__construct ($content_type= 'text/plain') | |
add_bcc ($mail, $name='') | |
add_cc ($mail, $name='') | |
add_part ($content, $type='text/html') | |
add_to ($mail, $name='') | |
add_user ($mail, $name='', $field='to') | |
add_users ($users, $field='to') | |
add_xoops_users ($users, $field='to') | |
assign ($var, $value) | |
attach_content ($type='path', $path= '', $content_type= '', $name='', $content=null, $disposition='') | |
batchSend () | |
create_body () | |
embed ($type, $file='', $name=null, $content_type=null) | |
errors () | |
get_bcc () | |
get_body () | |
get_cc () | |
get_return_path () | |
get_subject () | |
get_to () | |
& | message () |
send () | |
send_pm () | |
set_bcc ($recipients=array()) | |
set_body ($body, $content_type='') | |
set_cc ($recipients=array()) | |
set_from ($mail, $name) | |
set_from_xuser ($user) | |
set_return_path ($mail) | |
set_subject ($subject) | |
set_to ($recipients=array()) | |
template ($file, $type='') | |
& | transport () |
Private Attributes | |
$errors = array() | |
$swMailer | |
$swMessage | |
$swTransport | |
$template = '' | |
$tpl_type = '' | |
$vars = array() | |
$xusers = array() | |
Definition at line 21 of file mailer.php.
RMMailer::__construct | ( | $content_type = 'text/plain' | ) |
Class constructor. Load all data from configurations and generate the initial clases to manage the email
string | Content type for message body. It usually text/plain or text/html. Default is 'text/plain' but can be changed later |
Definition at line 55 of file mailer.php.
References RMFunctions\configs(), Swift_MailTransport\newInstance(), Swift_SendmailTransport\newInstance(), Swift_SmtpTransport\newInstance(), and Swift_Message\newInstance().
RMMailer::add_bcc | ( | $mail, | |
$name = '' |
|||
) |
Definition at line 290 of file mailer.php.
Referenced by add_user().
RMMailer::add_cc | ( | $mail, | |
$name = '' |
|||
) |
Add single recipient
string | Email address |
string | Name |
Definition at line 275 of file mailer.php.
Referenced by add_user().
RMMailer::add_part | ( | $content, | |
$type = 'text/html' |
|||
) |
Adds a part to message body.
string | Part body content |
string | Content type, default is text/html |
Definition at line 161 of file mailer.php.
RMMailer::add_to | ( | $mail, | |
$name = '' |
|||
) |
Add single recipient
string | Email address |
string | Name |
Definition at line 248 of file mailer.php.
Referenced by add_user().
RMMailer::add_user | ( | $mail, | |
$name = '' , |
|||
$field = 'to' |
|||
) |
Definition at line 318 of file mailer.php.
References $field, add_bcc(), add_cc(), and add_to().
Referenced by add_users(), and add_xoops_users().
RMMailer::add_users | ( | $users, | |
$field = 'to' |
|||
) |
Add Users as recipients for message. Users can be passed as object or as ids
array | Users (ids or objects) |
Definition at line 302 of file mailer.php.
References $field, $users, and add_user().
RMMailer::add_xoops_users | ( | $users, | |
$field = 'to' |
|||
) |
Add xoops users object to recipients list
mixed | A xoopsuser object or an array of xoopsuser objects |
Definition at line 337 of file mailer.php.
References $field, $users, and add_user().
RMMailer::assign | ( | $var, | |
$value | |||
) |
Definition at line 373 of file mailer.php.
RMMailer::attach_content | ( | $type = 'path' , |
|
$path = '' , |
|||
$content_type = '' , |
|||
$name = '' , |
|||
$content = null , |
|||
$disposition = '' |
|||
) |
Attach a file Note: Always is preferible get the Message object and work directly with it and with Attachement object
string | Type of file. Can be 'path' for existent files or 'dynamic' for dynamic content |
string | File path, when type = 'path'. The file must exists. Also can be a URL |
string | Content type for file (mime type) |
string | Set file name in the message |
mixed | Content for dynamic content |
string | File disposition (inline) |
Definition at line 176 of file mailer.php.
References $content, $path, $type, Swift_Attachment\fromPath(), and Swift_Attachment\newInstance().
RMMailer::batchSend | ( | ) |
Definition at line 451 of file mailer.php.
References create_body(), errors(), and Swift_Mailer\newInstance().
RMMailer::create_body | ( | ) |
Definition at line 396 of file mailer.php.
References $ret, $template, get_body(), and set_body().
Referenced by batchSend(), send(), and send_pm().
RMMailer::embed | ( | $type, | |
$file = '' , |
|||
$name = null , |
|||
$content_type = null |
|||
) |
Embed files into message Note: Is better to use the Message object directly
string | Path or dynamic |
string|mixed | Path to file or file content when type is dynamic |
string | File name |
string | Mime type of image |
Definition at line 211 of file mailer.php.
References $file, $type, Swift_Image\fromPath(), and Swift_Image\newInstance().
RMMailer::errors | ( | ) |
Get errors
Definition at line 392 of file mailer.php.
References $errors.
Referenced by batchSend(), and send().
RMMailer::get_bcc | ( | ) |
Definition at line 286 of file mailer.php.
RMMailer::get_body | ( | ) |
Returns the body content
Definition at line 140 of file mailer.php.
Referenced by create_body(), and send_pm().
RMMailer::get_cc | ( | ) |
RMMailer::get_return_path | ( | ) |
Definition at line 369 of file mailer.php.
RMMailer::get_subject | ( | ) |
Get the subject line
Definition at line 123 of file mailer.php.
Referenced by send_pm().
RMMailer::get_to | ( | ) |
& RMMailer::message | ( | ) |
Next functions allows to manage the Message object. You can obtain directly the Swift Message object and work directly with it. Get the message object
Definition at line 114 of file mailer.php.
References $swMessage.
RMMailer::send | ( | ) |
Definition at line 457 of file mailer.php.
References create_body(), errors(), and Swift_Mailer\newInstance().
RMMailer::send_pm | ( | ) |
Definition at line 427 of file mailer.php.
References create_body(), get_body(), and get_subject().
RMMailer::set_bcc | ( | $recipients = array() | ) |
Definition at line 281 of file mailer.php.
RMMailer::set_body | ( | $body, | |
$content_type = '' |
|||
) |
Set the body content and additionally can set the content_type If content type is not provided then it leaves without changes
string | $body | |
string | $content_type |
Definition at line 151 of file mailer.php.
Referenced by create_body().
RMMailer::set_cc | ( | $recipients = array() | ) |
This methods are similar to previous but for Cc recipients
array | Recipientes data array('recip'=>'Recipient Name',' ient @addr ess. comrecip',...) ent2 @addr ess. com |
Definition at line 257 of file mailer.php.
RMMailer::set_from | ( | $mail, | |
$name | |||
) |
Definition at line 86 of file mailer.php.
RMMailer::set_from_xuser | ( | $user | ) |
Definition at line 90 of file mailer.php.
References elseif().
RMMailer::set_return_path | ( | ) |
Sets the return path
string | Email for return path |
Definition at line 365 of file mailer.php.
RMMailer::set_subject | ( | $subject | ) |
RMMailer::set_to | ( | $recipients = array() | ) |
set all recipients in one go
array | Recipientes data array('recip'=>'Recipient Name',' ient @addr ess. comrecip',...) ent2 @addr ess. com |
Definition at line 230 of file mailer.php.
RMMailer::template | ( | $file, | |
$type = '' |
|||
) |
Assign a template to generate the message body
string | Path to file |
string | Template type. It can be "old" or '' |
Definition at line 383 of file mailer.php.
References $file.
& RMMailer::transport | ( | ) |
|
private |
|
private |
The mailet class
Definition at line 34 of file mailer.php.
|
private |
|
private |
|
private |
Definition at line 41 of file mailer.php.
Referenced by create_body().
|
private |
Definition at line 42 of file mailer.php.
|
private |
Definition at line 40 of file mailer.php.
|
private |
Definition at line 44 of file mailer.php.