TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Form\PostProcess\MailPostProcessor Class Reference
Inheritance diagram for TYPO3\CMS\Form\PostProcess\MailPostProcessor:
TYPO3\CMS\Form\PostProcess\PostProcessorInterface tx_form_System_Postprocessor_Mail

Public Member Functions

 __construct (\TYPO3\CMS\Form\Domain\Model\Form $form, array $typoScript)
 
 process ()
 

Protected Member Functions

 setSubject ()
 
 setFrom ()
 
 setTo ()
 
 setCc ()
 
 setReplyTo ()
 
 setPriority ()
 
 setOrganization ()
 
 setCharacterSet ()
 
 send ()
 
 sanitizeHeaderString ($string)
 
 addAttachmentsFromForm ()
 

Protected Attributes

 $form
 
 $typoScript
 
 $mailMessage
 
 $requestHandler
 
 $dirtyHeaders = array()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! The mail post processor

Author
Patrick Broens patri.nosp@m.ck@p.nosp@m.atric.nosp@m.kbro.nosp@m.ens.n.nosp@m.l

Definition at line 22 of file MailPostProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::__construct ( \TYPO3\CMS\Form\Domain\Model\Form  $form,
array  $typoScript 
)

Constructor

Parameters
\TYPO3\CMS\Form\Domain\Model\Form$formForm domain model
array$typoScriptPost processor TypoScript settings

Implements TYPO3\CMS\Form\PostProcess\PostProcessorInterface.

Definition at line 55 of file MailPostProcessor.php.

References TYPO3\CMS\Form\PostProcess\MailPostProcessor\$form, TYPO3\CMS\Form\PostProcess\MailPostProcessor\$typoScript, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ addAttachmentsFromForm()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::addAttachmentsFromForm ( )
protected

Add attachments when uploaded

Returns
void

Definition at line 339 of file MailPostProcessor.php.

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ process()

◆ sanitizeHeaderString()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::sanitizeHeaderString (   $string)
protected

Checks string for suspicious characters

Parameters
string$stringString to check
Returns
string Valid or empty string

Definition at line 325 of file MailPostProcessor.php.

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\setFrom(), TYPO3\CMS\Form\PostProcess\MailPostProcessor\setOrganization(), and TYPO3\CMS\Form\PostProcess\MailPostProcessor\setSubject().

◆ send()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::send ( )
protected

Sends the mail. Sending the mail requires the recipient and message to be set.

Returns
void

Definition at line 302 of file MailPostProcessor.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setCc()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setCc ( )
protected

Adds the carbon copy receiver of the mail message when configured

Checks the address if it is a valid email address

Returns
void

Definition at line 191 of file MailPostProcessor.php.

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setCharacterSet()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setCharacterSet ( )
protected

Set the default character set used

Respect formMailCharset if it was set, otherwise use metaCharset for mail if different from renderCharset

Returns
void

Definition at line 256 of file MailPostProcessor.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ setFrom()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setFrom ( )
protected

Sets the sender of the mail message

Mostly the sender is a combination of the name and the email address

Returns
void

Definition at line 111 of file MailPostProcessor.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\MailUtility\getSystemFromAddress(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Form\PostProcess\MailPostProcessor\sanitizeHeaderString().

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setOrganization()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setOrganization ( )
protected

Add a text header to the mail header of the type Organization

Sanitizes the header string when necessary

Returns
void

Definition at line 240 of file MailPostProcessor.php.

References TYPO3\CMS\Form\PostProcess\MailPostProcessor\sanitizeHeaderString().

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setPriority()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setPriority ( )
protected

Set the priority of the mail message

When not in settings, the value will be 3. If the priority is configured, but too big, it will be set to 5, which means very low.

Returns
void

Definition at line 225 of file MailPostProcessor.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setReplyTo()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setReplyTo ( )
protected

Adds the reply to header of the mail message when configured

Checks the address if it is a valid email address

Returns
void

Definition at line 205 of file MailPostProcessor.php.

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setSubject()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setSubject ( )
protected

Sets the subject of the mail message

If not configured, it will use a default setting

Returns
void

Definition at line 92 of file MailPostProcessor.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), and TYPO3\CMS\Form\PostProcess\MailPostProcessor\sanitizeHeaderString().

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

◆ setTo()

TYPO3\CMS\Form\PostProcess\MailPostProcessor::setTo ( )
protected

Adds the receiver of the mail message when configured

Checks the address if it is a valid email address

Returns
void

Definition at line 177 of file MailPostProcessor.php.

Referenced by TYPO3\CMS\Form\PostProcess\MailPostProcessor\process().

Member Data Documentation

◆ $dirtyHeaders

TYPO3\CMS\Form\PostProcess\MailPostProcessor::$dirtyHeaders = array()
protected

Definition at line 47 of file MailPostProcessor.php.

◆ $form

TYPO3\CMS\Form\PostProcess\MailPostProcessor::$form
protected

◆ $mailMessage

TYPO3\CMS\Form\PostProcess\MailPostProcessor::$mailMessage
protected

Definition at line 37 of file MailPostProcessor.php.

◆ $requestHandler

TYPO3\CMS\Form\PostProcess\MailPostProcessor::$requestHandler
protected

Definition at line 42 of file MailPostProcessor.php.

◆ $typoScript

TYPO3\CMS\Form\PostProcess\MailPostProcessor::$typoScript
protected