Skip to content

Commit

Permalink
Merge pull request #3 from amosfolz/develop-feature-update-phpmailer
Browse files Browse the repository at this point in the history
Update PHPMailer to 6.0.7
  • Loading branch information
lcharette authored Jun 25, 2019
2 parents 7429ef9 + 199b0f6 commit e2de173
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Changed minimum PHP Version to 7.1

### Changed Dependencies
- Updated PHPMailer/PHPMailer to 6.0.7
- Updated league/csv to 9.2.1
- Updated Laravel Illuminate packages to 5.8
- Updated Twig from 1.x to 2.x
Expand Down
2 changes: 1 addition & 1 deletion app/sprinkles/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"league/flysystem-rackspace": "~1.0",
"league/flysystem-sftp": "~1.0",
"monolog/monolog": "^1",
"phpmailer/phpmailer": "5.2.10",
"phpmailer/phpmailer": "^6.0.7",
"slim/csrf": "^0.8",
"slim/slim": "^3",
"slim/twig-view": "^2.5",
Expand Down
14 changes: 8 additions & 6 deletions app/sprinkles/core/src/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
namespace UserFrosting\Sprinkle\Core\Mail;

use Monolog\Logger;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception as phpmailerException;

/**
* Mailer Class.
Expand All @@ -37,14 +39,14 @@ class Mailer
* @param Logger $logger A Monolog logger, used to dump debugging info for SMTP server transactions.
* @param mixed[] $config An array of configuration parameters for phpMailer.
*
* @throws \phpmailerException Wrong mailer config value given.
* @throws phpmailerException Wrong mailer config value given.
*/
public function __construct($logger, $config = [])
{
$this->logger = $logger;

// 'true' tells PHPMailer to use exceptions instead of error codes
$this->phpMailer = new \PHPMailer(true);
$this->phpMailer = new PHPMailer(true);

// Configuration options
switch ($config['mailer']) {
Expand Down Expand Up @@ -79,7 +81,7 @@ public function __construct($logger, $config = [])
}
break;
default:
throw new \phpmailerException("'mailer' must be one of 'smtp', 'mail', 'qmail', or 'sendmail'.");
throw new phpmailerException("'mailer' must be one of 'smtp', 'mail', 'qmail', or 'sendmail'.");
}

// Set any additional message-specific options
Expand All @@ -97,7 +99,7 @@ public function __construct($logger, $config = [])
/**
* Get the underlying PHPMailer object.
*
* @return \PHPMailer
* @return PHPMailer
*/
public function getPhpMailer()
{
Expand All @@ -113,7 +115,7 @@ public function getPhpMailer()
* @param MailMessage $message
* @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
*
* @throws \phpmailerException The message could not be sent.
* @throws phpmailerException The message could not be sent.
*/
public function send(MailMessage $message, $clearRecipients = true)
{
Expand Down Expand Up @@ -163,7 +165,7 @@ public function send(MailMessage $message, $clearRecipients = true)
* @param MailMessage $message
* @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
*
* @throws \phpmailerException The message could not be sent.
* @throws phpmailerException The message could not be sent.
*/
public function sendDistinct(MailMessage $message, $clearRecipients = true)
{
Expand Down

0 comments on commit e2de173

Please sign in to comment.