Closed (fixed)
Project:
Elastic Email
Version:
7.x-2.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Feb 2011 at 18:40 UTC
Updated:
11 Feb 2016 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
neilotoole commentedEzra, can you please give me the exact versions of drupal, ubercart, etc. that you're using?
Comment #2
ezra commentedSorry for the delay, here is the info:
Drupal 6.20
MySQL database 5.1.50
PHP 5.2.6-1+lenny9
Ubercart 6.x-2.4
Comment #3
alexdav commentedHere's a small patch to allow the module to send out HTML emails when not specifically calling _elastic_email_send().
Comment #4
mike.davis commentedComment #5
mike.davis commentedHi @alexdav,
Thanks for your patch. I have checked it and there was a bit missing for the change to the _elastic_email_send function for the html body. I have updated the patch to include this as well as updating the way in which you were checking if the email needed to be html or not. I have used a check on the $message['header'] variable to determine if the email was text/plain or not.
If you could review this and let me know if this works correctly or not, then we can get it to RBTC and committed.
Comment #7
mike.davis commentedPatch committed, needs to be ported to 7.x-1.x branch now
Comment #8
mike.davis commentedHere is the patch for Drupal 7 version. This also adds a test button to the admin interface to test the sending of HTML emails.
Comment #10
mike.davis commentedThis has been committed now
Comment #12
Daemon_Byte commentedThis seems to be back for version 7.2.x
Comment #13
Daemon_Byte commentedI don't know why but changing
$s_html = (strpos($message['headers']['Content-Type'], 'text/plain') !== FALSE);
into 2 lines
$s_plain = strpos($message['headers']['Content-Type'], 'text/plain');
$s_html = ($s_plain === false);
fixed my problem. The top gave me false and the bottom gave me true.
Comment #14
mike.davis commentedHi @Daemon_Byte, thanks for using the module.
It is strange that this would be different between the 1.x and the 2.x versions.
Have you tried it using the 7.x-1.0 version to see if this works fine on this version - i.e. is this specific to the 7.x-2.x version or have you only used the 2.x version?
Also what PHP version are you using?
Thanks
Mike
Comment #15
Daemon_Byte commentedPHP Version 5.4.43. I did try the v1 version and it didn't work either. As I said I managed to narrow it down to that line and now I look at it again I understand the logic fail. In the version used by the code it looks to see if it finds the text string and if it doesn't (as in my case) strpos returns false. You then set html to be true only if strpos doesn't return false. I flipped that logic and said html is true if strpos returns false.
Comment #16
mike.davis commentedInteresting. I see that nor only have you put the vide onto 2 lines but flipped the logic.
Have you tried the flipped logic when it is just in one line?
Also if you can provide a patch I'd be happy to check it out and get it committed.
Comment #17
Daemon_Byte commentedI would imagine it would work on one line with the logic switched. I can't test it today but I will find a bit of time tomorrow to do so then get a patch file created.
Comment #18
mike.davis commentedHi @Daemon_Byte, I have finally had a chance to test this and this does seem to fix the issue.
Here is a patch for it.
Comment #19
mike.davis commentedThis has been committed now