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

Feat: enable SMTP debugging when not in production #1644

Closed
wants to merge 1 commit into from

Conversation

kodumbeats
Copy link
Contributor

@kodumbeats kodumbeats commented Sep 21, 2021

What does this PR do?

PHPMailer doesn't have very useful error messages by default, and in fact provides a URL to their wiki. This PR increases the debugging level of PHPMailer when not in production.

Test Plan

Check logs on failed SMTP delivery.

Unanswered questions

  • This will echo the logs by default, but I can overwrite the logging function. Will echoing logs work, or should we use the Utopia CLI lib?

Related PRs and Issues

#1390

Have you read the Contributing Guidelines on issues?

Yes.

@@ -76,6 +76,11 @@ public function run(): void
/** @var \PHPMailer\PHPMailer\PHPMailer $mail */
$mail = $register->get('smtp');

// https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#enabling-debug-output
if (App::getEnv('_APP_ENV') !== App::MODE_TYPE_PRODUCTION) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method makes more sense to me: https://github.com/utopia-php/framework/blob/master/src/App.php#L411
I would just double check we initialize the env setting in the worker scope the same way we do for the REST API.

@stnguyen90
Copy link
Contributor

@kodumbeats this is quite stale now and we've decided on a different approach for debugging. As such, can this be closed?

@TorstenDittmann TorstenDittmann deleted the feat-smtp-error-logging-development branch September 10, 2023 15:53
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

4 participants