Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
PKPMailTemplate Class Reference
Inheritance diagram for PKPMailTemplate:
Mail DataObject MailTemplate ArticleMailTemplate MassMail

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 ()
 PKPMailTemplate ($emailKey=null, $locale=null, $enableAttachments=null, $includeSignature=true)
processAddresses ($currentList, &$newAddresses)
 send ($clearAttachments=true)
 sendWithParams ($paramArray)
 setAddressFieldsEnabled ($addressFieldsEnabled)
- Public Member Functions inherited from Mail
 addAttachment ($filePath, $fileName= '', $contentType= '', $contentDisposition= 'attachment')
 addBcc ($email, $name= '')
 addCc ($email, $name= '')
 addHeader ($name, $content)
 addPrivateParam ($name, $value)
 addRecipient ($email, $name= '')
 clearAllRecipients ()
 encodeDisplayName ($displayName, $send=false)
 getAddressArrayString ($addresses, $includeNames=true, $send=false)
getAttachments ()
 getBccs ()
 getBccString ()
 getBody ()
 getCcs ()
 getCcString ()
 getContentType ()
 getEnvelopeSender ()
 getFrom ()
 getFromString ($send=false)
 getHeaders ()
 getRecipients ()
 getRecipientString ()
 getReplyTo ()
 getReplyToString ($send=false)
 getSubject ()
 hasAttachments ()
 Mail ()
 promoteCcsIfNoRecipients ()
 send ()
 setBccs ($bccs)
 setBody ($body)
 setCcs ($ccs)
 setContentType ($contentType)
 setEnvelopeSender ($envelopeSender)
 setFrom ($email, $name= '')
 setHeaders (&$headers)
 setPrivateParams ($privateParams)
 setRecipients ($recipients)
 setReplyTo ($email, $name= '')
 setSubject ($subject)
- Public Member Functions inherited from DataObject
 addSupportedMetadataAdapter (&$metadataAdapter)
 DataObject ($callHooks=true)
extractMetadata (&$metadataSchema)
 getAdditionalMetadataFieldNames ()
getAllData ()
getData ($key, $locale=null)
 getHasLoadableAdapters ()
 getId ()
 getLocaleMetadataFieldNames ()
getLocalizedData ($key)
 getMetadataFieldNames ($translated=true)
 getSetMetadataFieldNames ($translated=true)
getSupportedExtractionAdapters ()
getSupportedInjectionAdapters ()
getSupportedMetadataSchemas ()
 hasData ($key, $locale=null)
 injectMetadata (&$metadataDescription)
 removeSupportedMetadataAdapter ($metadataSchemaName)
 setAllData (&$data)
 setData ($key, $value, $locale=null)
 setHasLoadableAdapters ($hasLoadableAdapters)
 setId ($id)
upcastTo (&$targetObject)

Additional Inherited Members

- Public Attributes inherited from DataObject
 $_data = array()

Detailed Description

Subclass of Mail for mailing a template email.

Definition at line 21 of file

Member Function Documentation

PKPMailTemplate::_clearAttachments (   $userId)

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


Definition at line 335 of file

References PKPRequest\getUserVar().

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

PKPMailTemplate::_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 297 of file

References PKPRequest\getUser(), and PKPRequest\getUserVar().

Referenced by PKPMailTemplate().

PKPMailTemplate::addPersistAttachment (   $temporaryFile)

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

Definition at line 288 of file

PKPMailTemplate::assignParams (   $paramArray = array())

Assigns values to e-mail parameters.


Definition at line 116 of file

References Mail\getBody(), Mail\getSubject(), Mail\setBody(), and Mail\setSubject().

Referenced by sendWithParams().

PKPMailTemplate::clearRecipients (   $clearHeaders = true)

Clears the recipient, cc, and bcc lists.

$clearHeadersboolean if true, also clear headers

Definition at line 274 of file

References DataObject\setData().

PKPMailTemplate::displayEditForm (   $formActionUrl,
  $hiddenFormParams = null,
  $alternateTemplate = null,
  $additionalParameters = array() 

Displays an edit form to customize the email.


Definition at line 169 of file

References getAddressFieldsEnabled(), Mail\getBccs(), Mail\getBody(), Mail\getCcs(), Mail\getFromString(), Mail\getRecipients(), Mail\getSubject(), PKPRequest\getUser(), and PKPRequest\getUserVar().

PKPMailTemplate::getAddressFieldsEnabled ( )

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


Definition at line 99 of file

Referenced by displayEditForm().

PKPMailTemplate::hasErrors ( )

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

boolean true iff one or more error messages are stored.

Definition at line 107 of file

PKPMailTemplate::isEnabled ( )

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


Definition at line 136 of file

PKPMailTemplate::PKPMailTemplate (   $emailKey = null,
  $locale = null,
  $enableAttachments = null,
  $includeSignature = true 


$emailKeystring unique identifier for the template
$localestring locale of the template
$enableAttachmentsboolean optional Whether or not to enable article attachments in the template
$includeSignatureboolean optional

Definition at line 58 of file

References _handleAttachments(), AppLocale\getLocale(), PKPRequest\getUser(), PKPRequest\getUserVar(), and Config\getVar().

& PKPMailTemplate::processAddresses (   $currentList,

Processes form-submitted addresses for inclusion in the recipient list

$currentListarray Current recipient/cc/bcc list
$newAddressesarray "Raw" form parameter for additional addresses

Definition at line 146 of file

References String\regexp_match_get().

Referenced by MailTemplate\MailTemplate().

PKPMailTemplate::send (   $clearAttachments = true)

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

$clearAttachmentsboolean Whether to delete attachments after

Definition at line 217 of file

References _clearAttachments(), Mail\addAttachment(), Mail\addBcc(), and PKPRequest\getUser().

PKPMailTemplate::sendWithParams (   $paramArray)

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


Definition at line 253 of file

References assignParams(), Mail\getBody(), Mail\getHeaders(), Mail\getSubject(), Mail\send(), Mail\setBody(), Mail\setHeaders(), and Mail\setSubject().

PKPMailTemplate::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.


Definition at line 91 of file

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