mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixed indentation in Mailer
No functional changes
This commit is contained in:
parent
7327f120aa
commit
7f4c173369
@ -56,7 +56,6 @@ class Mailer {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We further wrap all of this into another multipart block
|
||||
list($fullBody, $headers) = $this->encodeMultipart($messageParts, "multipart/mixed");
|
||||
|
||||
@ -121,7 +120,6 @@ class Mailer {
|
||||
dieprintr($customheaders);
|
||||
}
|
||||
|
||||
|
||||
$bodyIsUnicode = (strpos($htmlContent,"&#") !== false);
|
||||
$plainEncoding = "";
|
||||
|
||||
@ -132,7 +130,6 @@ class Mailer {
|
||||
if(isset($bodyIsUnicode) && $bodyIsUnicode) $plainEncoding = "base64";
|
||||
}
|
||||
|
||||
|
||||
// If the subject line contains extended characters, we must encode the
|
||||
$subject = Convert::xml2raw($subject);
|
||||
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
|
||||
@ -148,7 +145,6 @@ class Mailer {
|
||||
// Make the HTML part
|
||||
$headers["Content-Type"] = "text/html; charset=utf-8";
|
||||
|
||||
|
||||
// Add basic wrapper tags if the body tag hasn't been given
|
||||
if(stripos($htmlContent, '<body') === false) {
|
||||
$htmlContent =
|
||||
@ -223,7 +219,6 @@ class Mailer {
|
||||
if (isset($headers['BCC'])) {$headers['Bcc']=$headers['BCC']; unset($headers['BCC']); }
|
||||
if (isset($headers['bcc'])) {$headers['Bcc']=$headers['bcc']; unset($headers['bcc']); }
|
||||
|
||||
|
||||
// Send the email
|
||||
$headers = $this->processHeaders($headers);
|
||||
$to = $this->validEmailAddr($to);
|
||||
@ -256,7 +251,6 @@ function encodeMultipart($parts, $contentType, $headers = false) {
|
||||
$baseMessage = "\nThis is a multi-part message in MIME format.";
|
||||
}
|
||||
|
||||
|
||||
$separator = "\n--$separator\n";
|
||||
$body = "$baseMessage\n" .
|
||||
$separator . implode("\n".$separator, $parts) . "\n" . trim($separator) . "--";
|
||||
@ -269,9 +263,13 @@ function encodeMultipart($parts, $contentType, $headers = false) {
|
||||
*/
|
||||
function processHeaders($headers, $body = false) {
|
||||
$res = '';
|
||||
if(is_array($headers)) while(list($k, $v) = each($headers))
|
||||
if(is_array($headers)) {
|
||||
while(list($k, $v) = each($headers)) {
|
||||
$res .= "$k: $v\n";
|
||||
}
|
||||
}
|
||||
if($body) $res .= "\n$body";
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -409,7 +407,6 @@ function validEmailAddr($emailAddress) {
|
||||
|
||||
$replacedContent = imageRewriter($htmlContent, 'wrapImagesInline_rewriter($URL)');
|
||||
|
||||
|
||||
// Make the HTML part
|
||||
$headers["Content-Type"] = "text/html; charset=utf-8";
|
||||
$headers["Content-Transfer-Encoding"] = "quoted-printable";
|
||||
|
Loading…
x
Reference in New Issue
Block a user