-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#2866 Generate text version of message at send time if not present #22632
Conversation
(Standard links)
|
d1d2266
to
d3892ca
Compare
test this please |
CRM/Utils/Mail.php
Outdated
// CRM-6224 | ||
if (trim(CRM_Utils_String::htmlToText($htmlMessage)) == '') { | ||
$htmlMessage = $params['html'] ?? FALSE; | ||
if (trim(CRM_Utils_String::htmlToText((string) $htmlMessage))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be == ''
like before, otherwise it always sets htmlMessage to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opps - yes!
There's a couple more like that. |
d3892ca
to
f14adce
Compare
I think the remaining test fails probably should be fixed in the test api_v3_JobTest::testMailReportForPrint /home/jenkins/bknix-dfl/build/core-22632-6dhic/web/sites/all/modules/civicrm/tests/phpunit/api/v3/JobTest.php:2359 |
f14adce
to
3377fc6
Compare
@demeritcowboy I've pushed up a fix to the tests - basically when we send out reports there is now a text version & an html version & the text version is shifted onto the start of the array. I think having the text version as well is kinda neutral (in that no-one has ever complained we didn't have it before :-)) |
I think that's fair. It's unlikely somebody is autoparsing these reports as system-to-system communications, as might have been a not-so-crazy thing to do in the previous century. |
$htmlMessage = FALSE; | ||
} | ||
$attachments = $params['attachments'] ?? NULL; | ||
if (!empty($params['text'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means you wouldn't be able to explicitly set the text to the empty string, but I can't think many people are currently doing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@demeritcowboy yeah my thinking is there isn't much use-case for it
Looks like line 2468 in the test also needs shifting by one array element. |
3377fc6
to
9d0bc57
Compare
thanks @demeritcowboy |
Overview
dev/core#2866 Generate text version of message at send time if not present
Before
send function only sends text version of the email if it is present
After
text version always included, converted from html
Technical Details
https://lab.civicrm.org/dev/core/-/issues/2866
Comments