Class Email
Class to support sending emails.
- Object
-
ViewableData
implements
IteratorAggregate
-
Email
Direct known subclasses
Member_ChangePasswordEmail,
Member_ForgotPasswordEmail,
Member_SignupEmail,
Newsletter_Email,
SimpleOrderPage_SubmittedFormEmail,
UserDefinedForm_SubmittedFormEmail
Methods summary
public static
|
#
set_mailer(
This can be used to provide a mailer class other than the default, e.g. for testing. |
public static
|
|
public
|
#
__construct( mixed $from = null, mixed $to = null, mixed $subject = null, mixed $body = null, mixed $bounceHandlerURL = null, mixed $cc = null, mixed $bcc = null )
Create a new email. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
addCustomHeader( string $headerName, string $headerValue )
Add a custom header to this value. Useful for implementing all those cool features that we didn't think of. |
public
|
|
public
|
|
public
|
|
public
string
|
|
protected
|
|
public
|
|
public
|
#
populateTemplate( mixed $data )
Populate this email template with values. This may be called many times. |
protected
|
#
parseVariables( mixed $isPlain = false )
Load all the template variables into the internal variables, including the template into body. Called before send() or debugSend() $isPlain=true will cause the template to be ignored, otherwise the GenericEmail template will be used and it won't be plain email :) |
public
string
|
#
renderWith( string|array|
Render this object into the template, and get the result as a string. You can
pass one of the following as the $template parameter: |
public static
|
|
public
boolean
|
|
public
boolean
|
|
public static
|
#
setAdminEmail( string $newEmail )
Used as a default sender address in the |
public static
string
|
|
public static
|
#
send_all_emails_to( mixed $emailAddress )
Send every email generated by the Email class to the given address. It will also add " [addressed to (email), cc to (email), bcc to (email)]" to the end of the subject line This can be used when testing, by putting a command like this in your _config.php file |
public static
|
#
cc_all_emails_to( mixed $emailAddress )
CC every email generated by the Email class to the given address. It won't affect the original delivery in the same way that send_all_emails_to does. It just adds a CC header with the given email address. Note that you can only call this once - subsequent calls will overwrite the configuration variable. |
public static
|
#
bcc_all_emails_to( mixed $emailAddress )
BCC every email generated by the Email class to the given address. It won't affect the original delivery in the same way that send_all_emails_to does. It just adds a BCC header with the given email address. Note that you can only call this once - subsequent calls will overwrite the configuration variable. |
public
boolean
|
|
public static
string
|
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
protected
mixed
|
$from | |
protected
mixed
|
$to | |
protected
mixed
|
$subject | |
protected
mixed
|
$body | |
protected
mixed
|
$plaintext_body | |
protected
mixed
|
$cc | |
protected
mixed
|
$bcc | |
protected static
mixed
|
$mailer | |
protected
array
|
$customHeaders | |
protected
array
|
$attachments | |
protected
boolean
|
$parseVariables_done | |
protected
string
|
$ss_template | |
protected
mixed
|
$template_data | |
protected
mixed
|
$bounceHandlerURL | |
public static
string
|
$admin_email_address | |
protected static
mixed
|
$send_all_emails_to | |
protected static
mixed
|
$bcc_all_emails_to | |
protected static
mixed
|
$cc_all_emails_to |
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems