MailTemplate Class Reference
[Mail]

Subclass of Mail for mailing a template email. More...

Inheritance diagram for MailTemplate:

Mail DataObject ArticleMailTemplate MassMail

List of all members.

Public Member Functions

 _clearAttachments ($userId)
 _handleAttachments ($userId)
 addPersistAttachment ($temporaryFile)
 assignParams ($paramArray=array())
 clearRecipients ($clearHeaders=true)
 displayEditForm ($formActionUrl, $hiddenFormParams=null, $alternateTemplate=null, $additionalParameters=array())
 getAddressFieldsEnabled ()
 hasErrors ()
 isEnabled ()
 MailTemplate ($emailKey=null, $locale=null, $enableAttachments=null, $journal=null)
processAddresses ($currentList, &$newAddresses)
 send ($clearAttachments=true)
 sendWithParams ($paramArray)
 setAddressFieldsEnabled ($addressFieldsEnabled)


Detailed Description

Subclass of Mail for mailing a template email.

Definition at line 21 of file MailTemplate.inc.php.


Member Function Documentation

MailTemplate._clearAttachments ( userId  ) 

Delete all attachments associated with this message. Called from send().

Parameters:
$userId int

Definition at line 437 of file MailTemplate.inc.php.

References Request.getUserVar().

Referenced by send(), and ArticleMailTemplate.send().

MailTemplate._handleAttachments ( userId  ) 

Handles attachments in a generalized manner in situations where an email message must span several requests. Called from the constructor when attachments are enabled.

Definition at line 399 of file MailTemplate.inc.php.

References Request.getUser(), and Request.getUserVar().

Referenced by MailTemplate().

MailTemplate.addPersistAttachment ( temporaryFile  ) 

Adds a persistent attachment to the current list. Persistent attachments MUST be previously initialized with handleAttachments.

Definition at line 390 of file MailTemplate.inc.php.

MailTemplate.assignParams ( paramArray = array()  ) 

Assigns values to e-mail parameters.

Parameters:
$paramArray array
Returns:
void

Reimplemented in ArticleMailTemplate.

Definition at line 189 of file MailTemplate.inc.php.

References Request.getRequestedJournalPath(), Request.getSite(), and Request.url().

Referenced by sendWithParams().

MailTemplate.clearRecipients ( clearHeaders = true  ) 

Clears the recipient, cc, and bcc lists.

Parameters:
$clearHeaders boolean if true, also clear headers
Returns:
void

Definition at line 376 of file MailTemplate.inc.php.

References DataObject.setData().

MailTemplate.displayEditForm ( formActionUrl,
hiddenFormParams = null,
alternateTemplate = null,
additionalParameters = array() 
)

Displays an edit form to customize the email.

Parameters:
$formActionUrl string
$hiddenFormParams array
Returns:
void

Definition at line 251 of file MailTemplate.inc.php.

References getAddressFieldsEnabled(), Mail.getFromString(), TemplateManager.getManager(), Request.getUser(), and Request.getUserVar().

MailTemplate.getAddressFieldsEnabled (  ) 

Get the enabled/disabled state of address fields on the email form.

Returns:
boolean

Definition at line 172 of file MailTemplate.inc.php.

Referenced by displayEditForm().

MailTemplate.hasErrors (  ) 

Check whether or not there were errors in the user input for this form.

Returns:
boolean true iff one or more error messages are stored.

Definition at line 180 of file MailTemplate.inc.php.

MailTemplate.isEnabled (  ) 

Returns true if the email template is enabled; false otherwise.

Returns:
boolean

Definition at line 220 of file MailTemplate.inc.php.

MailTemplate.MailTemplate ( emailKey = null,
locale = null,
enableAttachments = null,
journal = null 
)

Constructor.

Parameters:
$emailKey string unique identifier for the template
$locale string locale of the template
$enableAttachments boolean optional Whether or not to enable article attachments in the template
$journal object optional The journal this message relates to

Definition at line 61 of file MailTemplate.inc.php.

References _handleAttachments(), DAORegistry.getDAO(), Request.getJournal(), Locale.getLocale(), Request.getSite(), Request.getUser(), Request.getUserVar(), Config.getVar(), and processAddresses().

& MailTemplate.processAddresses ( currentList,
&$  newAddresses 
)

Processes form-submitted addresses for inclusion in the recipient list

Parameters:
$currentList array Current recipient/cc/bcc list
$newAddresses array "Raw" form parameter for additional addresses

Definition at line 230 of file MailTemplate.inc.php.

Referenced by MailTemplate().

MailTemplate.send ( clearAttachments = true  ) 

Send the email. Aside from calling the parent method, this actually attaches the persistent attachments if they are used.

Parameters:
$clearAttachments boolean Whether to delete attachments after

Definition at line 302 of file MailTemplate.inc.php.

References _clearAttachments(), Mail.addAttachment(), Request.getUser(), and Config.getVar().

MailTemplate.sendWithParams ( paramArray  ) 

Assigns user-specific values to email parameters, sends the email, then clears those values.

Parameters:
$paramArray array
Returns:
void

Reimplemented in ArticleMailTemplate.

Definition at line 355 of file MailTemplate.inc.php.

References assignParams(), and Mail.send().

MailTemplate.setAddressFieldsEnabled ( addressFieldsEnabled  ) 

Disable or enable the address fields on the email form. NOTE: This affects the displayed form ONLY; if disabling the address fields, callers should manually clearAllRecipients and add/set recipients just prior to sending.

Parameters:
$addressFieldsEnabled boolean

Definition at line 164 of file MailTemplate.inc.php.


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:44 2008 for Open Journal Systems by  doxygen 1.5.6