@@ -52,25 +52,25 @@ discard block |
||
| 52 | 52 | $mail->setFrom($from["email"], $from["name"]); |
| 53 | 53 | |
| 54 | 54 | // Add Recipients |
| 55 | - foreach ((array) $envelope->getTo() as $toItem) { |
|
| 55 | + foreach ((array)$envelope->getTo() as $toItem) { |
|
| 56 | 56 | $to = Util::decomposeEmail($toItem); |
| 57 | 57 | $mail->addAddress($to["email"], $to["name"]); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Add Carbon Copy |
| 61 | - foreach ((array) $envelope->getCC() as $ccItem) { |
|
| 61 | + foreach ((array)$envelope->getCC() as $ccItem) { |
|
| 62 | 62 | $cc = Util::decomposeEmail($ccItem); |
| 63 | 63 | $mail->addCC($cc["email"], $cc["name"]); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Add Blind Carbon Copy |
| 67 | - foreach ((array) $envelope->getBCC() as $bccItem) { |
|
| 67 | + foreach ((array)$envelope->getBCC() as $bccItem) { |
|
| 68 | 68 | $bcc = Util::decomposeEmail($bccItem); |
| 69 | 69 | $mail->addBCC($bcc["email"], $bcc["name"]); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Attachments |
| 73 | - foreach ((array) $envelope->getAttachments() as $name => $value) { |
|
| 73 | + foreach ((array)$envelope->getAttachments() as $name => $value) { |
|
| 74 | 74 | $mail->addAttachment($value['content'], $name, 'base64', $value['content-type']); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if (!empty($this->connection->getUsername())) { |
| 93 | 93 | $mail->SMTPAuth = true; |
| 94 | 94 | $mail->Username = $this->connection->getUsername(); // SMTP account username |
| 95 | - $mail->Password = $this->connection->getPassword(); // SMTP account password |
|
| 95 | + $mail->Password = $this->connection->getPassword(); // SMTP account password |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | if (!$mail->Send()) { |
@@ -52,12 +52,12 @@ |
||
| 52 | 52 | $params["async"] = true; |
| 53 | 53 | $params["ip_pool"] = "Main Pool"; |
| 54 | 54 | |
| 55 | - $sendTo = array_unique(array_merge((array) $envelope->getTo(), (array) $envelope->getCC())); |
|
| 55 | + $sendTo = array_unique(array_merge((array)$envelope->getTo(), (array)$envelope->getCC())); |
|
| 56 | 56 | foreach ($sendTo as $email) { |
| 57 | - $params['message']['to'][] = [ 'email' => $email, 'type' => 'to']; |
|
| 57 | + $params['message']['to'][] = ['email' => $email, 'type' => 'to']; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - foreach ((array) $envelope->getBCC() as $email) { |
|
| 60 | + foreach ((array)$envelope->getBCC() as $email) { |
|
| 61 | 61 | $params['message']['bcc_address'] = $email; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $message = $mail->getFullMessageEnvelope(); |
| 23 | 23 | |
| 24 | 24 | // Fix BCC header because PHPMailer does not send to us |
| 25 | - foreach ((array) $envelope->getBCC() as $bccEmail) { |
|
| 25 | + foreach ((array)$envelope->getBCC() as $bccEmail) { |
|
| 26 | 26 | $message = 'Bcc: '.$bccEmail."\n".$message; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $message = $mail->getFullMessageEnvelope(); |
| 25 | 25 | |
| 26 | 26 | // Fix BCC header because PHPMailer does not send to us |
| 27 | - foreach ((array) $envelope->getBCC() as $bccEmail) { |
|
| 27 | + foreach ((array)$envelope->getBCC() as $bccEmail) { |
|
| 28 | 28 | $message = 'Bcc: '.$bccEmail."\n".$message; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | new UploadFile('message', $message, 'message.mime') |
| 38 | 38 | ]; |
| 39 | 39 | // Add "To;" |
| 40 | - foreach ((array) $envelope->getTo() as $toEmail) { |
|
| 40 | + foreach ((array)$envelope->getTo() as $toEmail) { |
|
| 41 | 41 | $upload[] = new UploadFile('to', $toEmail); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function addAttachment($contentName, $filePath, $contentType) |
| 54 | 54 | { |
| 55 | - $this->_attachment[$contentName] = [ 'content' => $filePath, 'content-type' => $contentType]; |
|
| 55 | + $this->_attachment[$contentName] = ['content' => $filePath, 'content-type' => $contentType]; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function getFrom() |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | public static function mailerFactory(MailConnection $connection) |
| 190 | 190 | { |
| 191 | 191 | $protocol = $connection->getProtocol(); |
| 192 | - if (in_array($protocol, [ 'smtp', 'ssl', 'tls'])) { |
|
| 192 | + if (in_array($protocol, ['smtp', 'ssl', 'tls'])) { |
|
| 193 | 193 | $mail = new PHPMailerWrapper($connection); |
| 194 | 194 | } elseif ($protocol === "ses") { |
| 195 | 195 | $mail = new AmazonSesWrapper($connection); |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | throw new \Exception('Invalid Format Message'); |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - return $this->MIMEHeader . $this->MIMEBody; |
|
| 13 | + return $this->MIMEHeader.$this->MIMEBody; |
|
| 14 | 14 | } |
| 15 | 15 | } |