|
|
@ -188,6 +188,7 @@ class Message extends BaseMessage |
|
|
|
{ |
|
|
|
{ |
|
|
|
$message = $this->getSwiftMessage(); |
|
|
|
$message = $this->getSwiftMessage(); |
|
|
|
$oldBody = $message->getBody(); |
|
|
|
$oldBody = $message->getBody(); |
|
|
|
|
|
|
|
$charset = $message->getCharset(); |
|
|
|
if (empty($oldBody)) { |
|
|
|
if (empty($oldBody)) { |
|
|
|
$parts = $message->getChildren(); |
|
|
|
$parts = $message->getChildren(); |
|
|
|
$partFound = false; |
|
|
|
$partFound = false; |
|
|
@ -195,6 +196,7 @@ class Message extends BaseMessage |
|
|
|
if (!($part instanceof \Swift_Mime_Attachment)) { |
|
|
|
if (!($part instanceof \Swift_Mime_Attachment)) { |
|
|
|
/* @var \Swift_Mime_MimePart $part */ |
|
|
|
/* @var \Swift_Mime_MimePart $part */ |
|
|
|
if ($part->getContentType() == $contentType) { |
|
|
|
if ($part->getContentType() == $contentType) { |
|
|
|
|
|
|
|
$charset = $part->getCharset(); |
|
|
|
unset($parts[$key]); |
|
|
|
unset($parts[$key]); |
|
|
|
$partFound = true; |
|
|
|
$partFound = true; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -204,7 +206,7 @@ class Message extends BaseMessage |
|
|
|
if ($partFound) { |
|
|
|
if ($partFound) { |
|
|
|
reset($parts); |
|
|
|
reset($parts); |
|
|
|
$message->setChildren($parts); |
|
|
|
$message->setChildren($parts); |
|
|
|
$message->addPart($body, $contentType); |
|
|
|
$message->addPart($body, $contentType, $charset); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$message->setBody($body, $contentType); |
|
|
|
$message->setBody($body, $contentType); |
|
|
|
} |
|
|
|
} |
|
|
@ -215,8 +217,8 @@ class Message extends BaseMessage |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$message->setBody(null); |
|
|
|
$message->setBody(null); |
|
|
|
$message->setContentType(null); |
|
|
|
$message->setContentType(null); |
|
|
|
$message->addPart($oldBody, $oldContentType); |
|
|
|
$message->addPart($oldBody, $oldContentType, $charset); |
|
|
|
$message->addPart($body, $contentType); |
|
|
|
$message->addPart($body, $contentType, $charset); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|