mtymek/MtMail

triggerEvent header.post doesn't work (ZF3/Php7)

celtic34fr opened this issue · 2 comments

hi,

I use your compat v3 source in my ZF3 project, and I discover a bug : according my config file, my messages must be coding in charset : UTF-8, but at least I recieve with charset ASCII (default enconding value).
I try to trace it in PhpStorm/xdebug, but in Compose class, method compose when it execute :
$event->setName(ComposerEvent::EVENT_COMPOSE_PRE); $em->triggerEvent($event);
it doesn't execute MessageEncoding, method setMessageEncoding (I had set a breakpoint before).
I notice in the same time, that message attribute of event object is NULL, and will be initialize with the first add in the header of the message.

Is it normal in that case, that the message attribute doesn't be initialize ?
Why when the application notices an empty message, does not initialize it by reibnject the encoding (by method setMessageEncoding) ?

if possible can you send us a test case in phpunit reproducing the issue?

the test case :
-> config file : set encoding message to UTF8, use MessageEncoding, PlainTextMessage composer plugins
-> build an message and try to send it

Remarks :
1/ I'll use the last ZF3 version in Ubuntu 16.04 environment, Php 7.0.13, Apache 2.4.18
2/ I'll install MtMail compat V3 source in my project,
3/ event I'll activate any composer plugins (PlainTextMessage, MessageEncoding) i"ll have no effect in the final message that I'll receive in my mail box (problems of eventManager, triggerEvent ? that's my first idea about this problem)

Gilbert ARMENGAUD
(celtic34fr)
'Béziers / Occitanie / France)