Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed try catch to allow Craft Mailer to catch exceptions #13

Merged
merged 1 commit into from Jun 8, 2021
Merged

Removed try catch to allow Craft Mailer to catch exceptions #13

merged 1 commit into from Jun 8, 2021

Conversation

noahjahn
Copy link
Contributor

@noahjahn noahjahn commented Jun 7, 2021

This PR was raised to help those trying to diagnose problems with their SES configuration.

Enhancements

  • Removed try catch to allow Craft Mailer to catch exceptions

@bencroker
Copy link
Collaborator

Thanks for the PR. Since the Mailer class catches exceptions, I wonder if it would be better to remove the try/catch statement completely. Would you mind testing this and see if the results are the same?

    public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null): int
    {
        $data = $this->_formatMessage($message);

        $this->_client->sendRawEmail($data);

        return count($message->getTo());
    }

@noahjahn
Copy link
Contributor Author

noahjahn commented Jun 8, 2021

Aha, great catch. For some reason I thought this function was overriding the Craft Mailer send method..

The results are the same with your suggestion -- thanks!

@noahjahn noahjahn changed the title Added a warning message when sending mail fails Removed try catch to allow Craft Mailer to catch exceptions Jun 8, 2021
@bencroker bencroker merged commit 714785d into putyourlightson:v1 Jun 8, 2021
@bencroker
Copy link
Collaborator

Merged, thanks!

@bencroker
Copy link
Collaborator

Released in 1.3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants