@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public static function getFullEmail($email, $name = "") |
| 19 | 19 | { |
| 20 | 20 | if (!empty($name)) { |
| 21 | - return "\"" . $name . "\" <" . $email . ">"; |
|
| 21 | + return "\"".$name."\" <".$email.">"; |
|
| 22 | 22 | } else { |
| 23 | 23 | return $email; |
| 24 | 24 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | // Fix BCC header because PHPMailer does not send to us |
| 27 | 27 | foreach ((array)$envelope->getBCC() as $bccEmail) { |
| 28 | - $messageParts['header'] .= 'Bcc: ' . $bccEmail . "\n"; |
|
| 28 | + $messageParts['header'] .= 'Bcc: '.$bccEmail."\n"; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | foreach ($envelope->getTo() as $toEmail) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // Add Blind Carbon Copy |
| 64 | 64 | foreach ((array)$envelope->getBCC() as $bccItem) { |
| 65 | 65 | $bcc = Util::decomposeEmail($bccItem); |
| 66 | - $mail->addCustomHeader("Bcc: " . $bcc["email"]); |
|
| 66 | + $mail->addCustomHeader("Bcc: ".$bcc["email"]); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Attachments |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if (!empty($this->uri->getUsername())) { |
| 109 | 109 | $mail->SMTPAuth = true; |
| 110 | 110 | $mail->Username = $this->uri->getUsername(); // SMTP account username |
| 111 | - $mail->Password = $this->uri->getPassword(); // SMTP account password |
|
| 111 | + $mail->Password = $this->uri->getPassword(); // SMTP account password |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if (!$mail->send()) { |
@@ -69,22 +69,22 @@ |
||
| 69 | 69 | // Attachments |
| 70 | 70 | foreach ((array)$envelope->getAttachments() as $name => $value) { |
| 71 | 71 | switch ($value['disposition']) { |
| 72 | - case 'attachment': |
|
| 73 | - $mail->addAttachment( |
|
| 74 | - $value['content'], |
|
| 75 | - $name, |
|
| 76 | - 'base64', |
|
| 77 | - $value['content-type'], |
|
| 78 | - 'attachment' |
|
| 79 | - ); |
|
| 80 | - break; |
|
| 81 | - |
|
| 82 | - case 'inline': |
|
| 83 | - $mail->addEmbeddedImage($value['content'], $name, $name, 'base64', $value['content-type']); |
|
| 84 | - break; |
|
| 85 | - |
|
| 86 | - default: |
|
| 87 | - throw new \InvalidArgumentException('Invalid attachment type'); |
|
| 72 | + case 'attachment': |
|
| 73 | + $mail->addAttachment( |
|
| 74 | + $value['content'], |
|
| 75 | + $name, |
|
| 76 | + 'base64', |
|
| 77 | + $value['content-type'], |
|
| 78 | + 'attachment' |
|
| 79 | + ); |
|
| 80 | + break; |
|
| 81 | + |
|
| 82 | + case 'inline': |
|
| 83 | + $mail->addEmbeddedImage($value['content'], $name, $name, 'base64', $value['content-type']); |
|
| 84 | + break; |
|
| 85 | + |
|
| 86 | + default: |
|
| 87 | + throw new \InvalidArgumentException('Invalid attachment type'); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $parts = $this->getMessageEnvelopeParts(); |
| 23 | 23 | |
| 24 | - return $parts['header'] . $parts['body']; |
|
| 24 | + return $parts['header'].$parts['body']; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -98,11 +98,11 @@ |
||
| 98 | 98 | |
| 99 | 99 | $result = $this->client->sendRequest($request); |
| 100 | 100 | if ($result->getStatusCode() != 200) { |
| 101 | - throw new MailApiException("Mailgun result code is " . $result->getStatusCode()); |
|
| 101 | + throw new MailApiException("Mailgun result code is ".$result->getStatusCode()); |
|
| 102 | 102 | } |
| 103 | 103 | $resultJson = json_decode($result->getBody()->getContents(), true); |
| 104 | 104 | if (!isset($resultJson['id'])) { |
| 105 | - throw new MailApiException('Mailgun: ' . $resultJson['message']); |
|
| 105 | + throw new MailApiException('Mailgun: '.$resultJson['message']); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return true; |