HTML email handler v2.3

Release Notes

2.3 (2012-11-06):

  • added: custom send date option (thanks to migrax https://github.com/migrax)
  • fixed: error in getting extra sendmail options
  • fixed: PHP notices
  • fixed: subject and to/from encoding (thanks to migrax https://github.com/migrax)
  • fixed: CC and BCC not working due to wrong placement of some headers (thanks to migrax https://github.com/migrax)
  • changed: registration of menu items
  • changed: some code cleanup
  • @Juho Jaakkola:

    Is there some specific reason why "email, system" plugin hook is never triggered in the plugin? Would it cause problems with other plugins or did you just feel that it's not needed?

    The absence of the hook makes it impossible to use some other email related plugins at the same time since your plugin completely replaces the notification handler for email notifications.

    Do you think you could add the trigger for the hook?

    If you wish to use the functions of this plugin without it taking over the notifications, you can disable this in the plugin settings.

    If this plugin is configured to takeover the notifications no hook is fired because you wish to use this plugin ;)

  • @Jerome Bakker : too many gifts today, please take a rest and keep a good shape. We want you around for a looooong time here, don't stress yourself! ;)

  • If this plugin is configured to takeover the notifications no hook is fired because you wish to use this plugin

    The plugin I would use with this would not send the emails. It would just modify the contents of the message body that this plugin creates. My plugin would add features, not replace them.

  • @Juho Jaakkola :

    The plugin I would use with this would not send the emails. It would just modify the contents of the message body that this plugin creates. My plugin would add features, not replace them.

    Having the "email", "system" hook doesn't allow you to modify the contents of the message body without also having make sure you send the emails.

  • Oops, I take back the "not replacing anything". It seems that was not completely true. :)

    However by the time the hook were triggered, your plugin would had already created the HTML body for the email. Other plugins could then make their modifications to the message (...and then also take care of actually sending the email).

    A bit hacky, I admit, now that I took a bit deeper look into the code.

  • Its late, so my question is most likely stupid.

    Just want to check if this is intended design.

    Seems notifications work well with HTML email in the body and the template wrapped around.

    Direct "Send Message" has the HTML wrapper, but the body of the message is stripped.

    Maybe I missed something..

  • Tested this on my debug instance which is a completely uncustomized install. Same result as above. HTML is stripped from the body of a direct message between users. Works find with discussion groups notifications. It does have the wrapper and header, just the body is striped.

    The process I use to send a message, is login as random user, got to members page, select send message on the avatar menu of a random member. Notification message comes through with wrapper and just plain text body.

    Any clue on how to fix would be appreciated..

  • @buraddo:

    Its late, so my question is most likely stupid.

    Just want to check if this is intended design.

    Seems notifications work well with HTML email in the body and the template wrapped around.

    Direct "Send Message" has the HTML wrapper, but the body of the message is stripped.

    Maybe I missed something..

    Check /mod/messages/start.php around line 290:

    $message_contents = strip_tags($body);

    And $message_contents is send to notify_user which is picked up by html_email_handler, so I don't get a HTML body.

  • @Satheesh PM:

    mail_queue (http://community.elgg.org/pg/plugins/project/616834/developer/mcampo/mail-queue

    so this plugin enable queued sending of all system mails?

    yes it queues message sending, but it's incompatible with html_email_handler

  • i was just asking, is html_email_handler queues the messages sending? so that it will not load server at once....??

     

  • @Satheesh PM

    i was just asking, is html_email_handler queues the messages sending? so that it will not load server at once....??

    Sorry, I misundrstood. No html_email_handler doesn't queue the sending of messages. Also it's not a planned feature.

  • @ Jerome

    Line 290 of mod/messages/start.php did the trick

    Now I have to work out why extra lines are being inserted in the messages..

    Thanks

    B

  • I made this request to support special characters in email subjects: https://github.com/ColdTrick/html_email_handler/issues/7

  • @Jerome

    Trying to nut through a problem. Not sure if its the HTML Email Handler plugin or elsewhere.

    If I insert tables in the discussions.. The messages sent using the HTML Email Handler plugin have a bunch of extra <br> tags.

    If I look at the HTML of the original discussion it does not seem to have them.

    Any ideas ?

     

    Brad

     

     

  • @buraddo

    Trying to nut through a problem. Not sure if its the HTML Email Handler plugin or elsewhere.

    If I insert tables in the discussions.. The messages sent using the HTML Email Handler plugin have a bunch of extra <br> tags.

    If I look at the HTML of the original discussion it does not seem to have them.

    Any ideas ?

    HTML email handler doesn't add html. All it does is make all the css inline. So i don't know where this comes from.

    Do you also get the extra html in the html_email_hander_send_mail function??? If so, some other plugin breaks it ;)

  • Just closing this thread. Found the extra <br>

    Its in;

     mod/html_email_handler/views/default/html_email_handler/notification/body.php

    there is a PHP nlbr function being used to parse the message body. Its adding an extra BR for every New Line which is not working when the messages are already HTML from the MCE editor.

    If I remove it, everything seems to work. Not sure why the nlbr was necessary and I hope I am not going to break an edge case.

    Brad

Jerome Bakker

Developer @ ColdTrick IT Solutions

Stats

  • Category: Communication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2019-4-9
  • Downloads: 7688
  • Recommendations: 37

Other Projects

View Jerome Bakker's plugins