oc-mail icon indicating copy to clipboard operation
oc-mail copied to clipboard

Doesn't work, no error

Open triasrahman opened this issue 9 years ago • 5 comments

Doesn't work, and no error found. What's wrong? I use PHP mail. The email is successfully sent, but no log there.

triasrahman avatar Jan 12 '16 13:01 triasrahman

Unfortunately, it doesn't work. Tested via smtp and AWS SES. Mail has been sent, but no log items, no hidden images in mail body.

mafin avatar Feb 25 '16 20:02 mafin

There is a bug in Rainlab.User (at least in 1.2.1) plugin that blocks all subscribers for event 'mailer.prepareSend'. That's why this plugin will not work. Replace this in Rainlab.User Plugin.php Event::listen('mailer.prepareSend', function($mailer, $view, $message){ return MailBlocker::filterMessage($view, $message); }); with this Event::listen('mailer.prepareSend', function($mailer, $view, $message){ return MailBlocker::filterMessage($view, $message) ? null : false; });

bashorgru avatar Mar 17 '16 13:03 bashorgru

There is also bug in October core, it returns error:

[2016-04-23 20:02:48] dev.ERROR: exception 'ErrorException' with message 'Missing argument 6 for Illuminate\Database\Eloquent\Relations\HasManyThrough::__construct(), called in /usr/local/www/data/mysite.com/beta/vendor/october/rain/src/Database/Relations/HasManyThrough.php on line 22 and defined' in /usr/local/www/data/mysite.com/beta/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php:52

I already reported at https://github.com/octobercms/library/issues/209

So it also doesn't work for me, zero logged e-mails at all.

vojtasvoboda avatar Apr 23 '16 20:04 vojtasvoboda

@bashorgru I'm having trouble seeing why this code change is necessary? The mail.prepareSend event will only halt if the value returned is === false, so these changes should not make any difference? Please submit a PR to the user plugin to discuss further.

daftspunk avatar May 12 '16 20:05 daftspunk

Let's figure it out. It's simple. First, \October\Rain\Mail\Mailer fire event 'mailer.prepareSend' with halt flag (code). Next, \Illuminate\Events\Dispatcher as Event start propagating event through listeners, call that function setted from \Rainlab\User\Plugin and then stop propagating to the rest of listeners. Propagating stopped because that function returns a result (boolean). But it should return null to allow processing the rest of listeners (read comments here). I assume it's a bug in Rainlab.User. Issue link.

bashorgru avatar Sep 13 '16 00:09 bashorgru