Newer
Older
$this->setCcAddresses($template->getCc());
$this->setBccAddresses($template->getBcc());
$this->setReplyToAddress($template->getReplyTo());
$this->setFromName($fromName);
}
/**
* Sets the fromMail property of the mailTemplateService.
* Checks validity and uses all available fallbacks
*
* @param string $fromMail
* @return string
*/
private function getValidFromMail($fromMail): string {
$fromMail = \trim($fromMail);
if (!\filter_var($fromMail, FILTER_VALIDATE_EMAIL)) {
$fromMail = $this->fromAddress;
}
if (!\filter_var($fromMail, FILTER_VALIDATE_EMAIL)) {
$fromMail = $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'];
if (!\filter_var($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'], FILTER_VALIDATE_EMAIL)) {
$fromMail = 'noreply@example.com';
}
}
return $fromMail;
/**
* Get a single variable containing a list of all markers
*
* @param array $markers
* @return string
*/
private function getAllMarker(array $markers): string {
$allMarker = '';
foreach ($markers as $key => $value) {
if (\array_key_exists($key, $this->markerLabels) && $this->markerLabels[$key] !== NULL) {
$key = $this->markerLabels[$key];
}
if (\is_string($value)) {
$allMarker .= $key . ': ' . $value . PHP_EOL;
} elseif (\is_array($value)) {
foreach ($value as $innerKey => $innerValue) {
$allMarker .= $key . '.' . $innerKey . ': ' . $innerValue . PHP_EOL;
} elseif (\is_bool($value)) {
$valueAsString = $value ? 'true' : 'false';
$allMarker .= $key . ': ' . $valueAsString . PHP_EOL;
} elseif (\is_object($value)) {
if (\method_exists($value, '__toString')) {
$allMarker .= $key . ': ' . $value->__toString() . PHP_EOL;
}
}
}
return $allMarker;
}