EmailMessageUtil Class Reference

Static Public Member Functions

static resolveEmailMessageFromPostData (Array &$postData, CreateEmailMessageForm $emailMessageForm, User $userToSendMessagesFrom)
static attachRecipientsToMessage (Array $recipients, EmailMessage $emailMessage, $type)
static attachFilesToMessage (Array $filesIds, $emailMessage)
static resolveSignatureToEmailMessage (EmailMessage $emailMessage, User $user)
static resolvePersonOrAccountToEmailMessage (EmailMessage $emailMessage, User $user, $toAddress=null, $relatedId=null, $relatedModelClassName=null)
static renderEmailAddressAsMailToOrModalLinkStringContent ($emailAddress, RedBeanModel $model)
static resolveTextContent ($htmlContent, $textContent)

Detailed Description

Helper class for working with Email Messages.

Definition at line 41 of file EmailMessageUtil.php.


Member Function Documentation

static resolveEmailMessageFromPostData ( Array &$  postData,
CreateEmailMessageForm emailMessageForm,
User userToSendMessagesFrom 
) [static]

Given post data and an email message, populate the sender and account on the email message if possible. Also add message recipients and any attachments.

Parameters:
array $postData
EmailMessage $emailMessage
User $userToSendMessagesFrom
Returns:
boolean Given post data and an email message, populate the sender and account on the email message if possible. Also add message recipients and any attachments.
Parameters:
array $postData
CreateEmailMessageForm $emailMessageForm
User $userToSendMessagesFrom
Returns:
CreateEmailMessageForm

Definition at line 60 of file EmailMessageUtil.php.

static attachRecipientsToMessage ( Array $  recipients,
EmailMessage emailMessage,
type 
) [static]

Adds recipient emails as recipients to the email message. If the recipient email already matches an person or account on the email message it will ignore it.

Parameters:
Array $recipients
EmailMessage $emailMessage
integer $type

Definition at line 111 of file EmailMessageUtil.php.

static attachFilesToMessage ( Array $  filesIds,
emailMessage 
) [static]
Parameters:
array $filesIds
EmailMessage $emailMessage

Definition at line 162 of file EmailMessageUtil.php.

static resolveSignatureToEmailMessage ( EmailMessage emailMessage,
User user 
) [static]

Append the email signature, if a user has one, to the htmlContent of the email message.

Parameters:
EmailMessage $emailMessage
User $user

Definition at line 176 of file EmailMessageUtil.php.

static resolvePersonOrAccountToEmailMessage ( EmailMessage emailMessage,
User user,
toAddress = null,
relatedId = null,
relatedModelClassName = null 
) [static]
Parameters:
EmailMessage $emailMessage
User $user
string $toAddress
mixed $relatedId
string $relatedModelClassName

Definition at line 191 of file EmailMessageUtil.php.

static renderEmailAddressAsMailToOrModalLinkStringContent ( emailAddress,
RedBeanModel model 
) [static]

Based on security, render an email address as a clickable link to a modal window or just a mailto: link that will open the user's configured email client.

Parameters:
EmailMessage $emailAddress
RedBeanModel $model
Returns:
string $content

Definition at line 218 of file EmailMessageUtil.php.

static resolveTextContent ( htmlContent,
textContent 
) [static]
Parameters:
string $htmlContent
string $textContent
Returns:
mixed

Definition at line 269 of file EmailMessageUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sat Oct 21 07:10:25 2017