Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
MailTemplate Class Reference
Inheritance diagram for MailTemplate:
Mail DataObject MassMail SubmissionMailTemplate MonographMailTemplate

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, $context=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 ()
 
 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 ()
 
 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)
 

Public Attributes

 $addressFieldsEnabled
 
 $bccSender
 
 $context
 
 $emailKey
 
 $enabled
 
 $errorMessages
 
 $includeSignature
 
 $locale
 
 $persistAttachments
 
 $skip
 
- Public Attributes inherited from Mail
 $privateParams
 
- Public Attributes inherited from DataObject
 $_data = array()
 
 $_extractionAdaptersLoaded = false
 
 $_hasLoadableAdapters = false
 
 $_injectionAdaptersLoaded = false
 
 $_metadataExtractionAdapters = array()
 
 $_metadataInjectionAdapters = array()
 

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
$userIdint

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

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 441 of file MailTemplate.inc.php.

MailTemplate::addPersistAttachment (   $temporaryFile)

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

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

References PKPRequest\getUser().

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

Assigns values to e-mail parameters.

Parameters
$paramArrayarray
Returns
void

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

MailTemplate::clearRecipients (   $clearHeaders = true)

Clears the recipient, cc, and bcc lists.

Parameters
$clearHeadersboolean if true, also clear headers
Returns
void

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

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

Displays an edit form to customize the email.

Parameters
$formActionUrlstring
$hiddenFormParamsarray
Returns
void

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

MailTemplate::getAddressFieldsEnabled ( )

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

Returns
boolean

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

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 214 of file MailTemplate.inc.php.

MailTemplate::isEnabled ( )

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

Returns
boolean

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

MailTemplate::MailTemplate (   $emailKey = null,
  $locale = null,
  $enableAttachments = null,
  $context = null,
  $includeSignature = true 
)

Constructor.

Parameters
$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 93 of file MailTemplate.inc.php.

References $context, and DAORegistry\getDAO().

& MailTemplate::processAddresses (   $currentList,
$newAddresses 
)

Processes form-submitted addresses for inclusion in the recipient list

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

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

MailTemplate::send (   $clearAttachments = true)

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

Parameters
$clearAttachmentsboolean Whether to delete attachments after

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

MailTemplate::sendWithParams (   $paramArray)

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

Parameters
$paramArrayarray
Returns
void

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

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
$addressFieldsEnabledboolean

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

Member Data Documentation

boolean MailTemplate::$addressFieldsEnabled

Whether or not email fields are disabled

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

boolean MailTemplate::$bccSender

whether or not to bcc the sender

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

object MailTemplate::$context

The context this message relates to

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

Referenced by MailTemplate().

string MailTemplate::$emailKey

Key of the email template we are using

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

Referenced by MassMail\MassMail(), and MonographMailTemplate\MonographMailTemplate().

boolean MailTemplate::$enabled

email template is enabled

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

array MailTemplate::$errorMessages

List of errors to display to the user

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

boolean MailTemplate::$includeSignature

whether to include the context's signature

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

Referenced by MonographMailTemplate\MonographMailTemplate().

string MailTemplate::$locale

locale of this template

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

Referenced by MassMail\MassMail(), and MonographMailTemplate\MonographMailTemplate().

array MailTemplate::$persistAttachments

List of temporary files belonging to email; these are maintained between requests and only sent to the attachment handling functions in Mail.inc.php at time of send.

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

boolean MailTemplate::$skip

If set to true, this message has been skipped during the editing process by the user.

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


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