| @@ 205-220 (lines=16) @@ | ||
| 202 | switch ($message->getContentType()) { |
|
| 203 | case 'text/html': |
|
| 204 | case 'multipart/alternative': |
|
| 205 | case 'multipart/mixed': |
|
| 206 | ||
| 207 | // text/plain, if present, must be the first key according to the docs. |
|
| 208 | if ($plain = $this->getMimePart($message, 'text/plain')) { |
|
| 209 | $payload['content'][] = [ |
|
| 210 | 'type' => 'text/plain', |
|
| 211 | 'value' => $plain->getBody() |
|
| 212 | ]; |
|
| 213 | } |
|
| 214 | ||
| 215 | $payload['content'][] = [ |
|
| 216 | 'type' => 'text/html', |
|
| 217 | 'value' => $message->getBody() |
|
| 218 | ]; |
|
| 219 | ||
| 220 | break; |
|
| 221 | ||
| 222 | default: |
|
| 223 | ||
| @@ 222-234 (lines=13) @@ | ||
| 219 | ||
| 220 | break; |
|
| 221 | ||
| 222 | default: |
|
| 223 | ||
| 224 | $payload['content'][] = [ |
|
| 225 | 'type' => 'text/plain', |
|
| 226 | 'value' => $message->getBody() |
|
| 227 | ]; |
|
| 228 | ||
| 229 | if ($html = $this->getMimePart($message, 'text/html')) { |
|
| 230 | $payload['content'][] = [ |
|
| 231 | 'type' => 'text/html', |
|
| 232 | 'value' => $html->getBody() |
|
| 233 | ]; |
|
| 234 | } |
|
| 235 | } |
|
| 236 | } |
|
| 237 | ||