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

Email notification seems to not work #5

Open
pmhou opened this issue Feb 27, 2017 · 10 comments
Open

Email notification seems to not work #5

pmhou opened this issue Feb 27, 2017 · 10 comments
Labels

Comments

@pmhou
Copy link

pmhou commented Feb 27, 2017

I have my mailer settings set up and working with Mailgun credentials.

I've set logging level to 100 and unchecked 'Disable when debug' and triggered an error with Log::error('Test');

The error is written to the system log file and appears in the Event Log but no email sent.

@vojtasvoboda
Copy link
Owner

I'm sorry to hear you have a problem with Error Logger plugin. I just cloned fresh OctoberCMS master branch, keep config files with default values, install Error Logger plugin and set plugin like this:

snimek obrazovky 2017-02-27 v 21 18 50

Then fire a error in template:

snimek obrazovky 2017-02-27 v 21 16 49

And got mail to my mailbox in a few seconds:

snimek obrazovky 2017-02-27 v 21 21 24

I recommend you try to send Log::error with PHP mail method, to eliminate Mailgun misconfiguration. Also check mail.pretend config value to be false.

@pmhou
Copy link
Author

pmhou commented Feb 28, 2017

My Mailgun settings are definitely correct as I can trigger emails using the Mail facade no problem. I have also changed my settings to use PHP Mail, Log file and SMTP - all of which successfully send emails, just not when an error is triggered.

I can confirm mail.pretend is set to false.

@vojtasvoboda
Copy link
Owner

Are you using some other Loggers? Slack, Syslog, New Relic, Sentry, Bugsnag? Maybe some other Logger "steals" the logged data.

@vojtasvoboda
Copy link
Owner

vojtasvoboda commented Feb 28, 2017

Now I tried a combination of Mail logger and Slack logger and both works well:

logger

So I don't know where could be your problem. I can't reproduce your issue. Could you please put your project somewhere to the Git, where I can try it? Let me know directly to email please. Thanks.

@pmhou
Copy link
Author

pmhou commented Apr 11, 2017

I've just had the opportunity to look at this again. It appears that your plugin only uses PHP's mail() method to send email. Is that correct?

@vojtasvoboda
Copy link
Owner

vojtasvoboda commented Apr 11, 2017

Yes, you are right. This plugin uses Monolog/NativeMailerHandler, which uses plain mail() function to send e-mails:

https:/Seldaek/monolog/blob/master/src/Monolog/Handler/NativeMailerHandler.php#L140

@pmhou
Copy link
Author

pmhou commented Apr 11, 2017

I didn't realise that was the case when I posted this issue. Native mail is not set up by default with Laravel Homestead which was causing the issue. I assumed whichever mail method specified in the October settings would be used.

@vojtasvoboda
Copy link
Owner

vojtasvoboda commented Apr 11, 2017

Me niether. I also thought that NativeMailerHandler using Laravel Mail function, so you can configure mail/smtp etc.

I have to update documentation.

@LukeTowers
Copy link

@vojtasvoboda do you have any plans to utilize the default mail driver configured for the application to send error messages instead of the built in mail() method? The mail() method in PHP is inherently insecure and potentially vulnerable, in fact SwiftMailer has dropped support for it entirely.

@vojtasvoboda
Copy link
Owner

@LukeTowers this plugin only register Monolog\Handler\NativeMailerHandler to the OctoberCMS. So all the magic is in this handler and there is no way how to inject own mail sender or configure sending.

So I've prepared integration of Monolog\Handler\SwiftMailerHandler, which using OctoberCMS Swift mailer: #7

I tried it now with Mailtrap.io configured in OctoberCMS Mail settings and seems to works. Could you please test it? Thanks a lot

@pmhou Hi Pete, there is new Swift Mailer handler, so now you can use OctoberCMS mail configuration. Could you please test it? Thanks a lot

@vojtasvoboda vojtasvoboda reopened this Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants