Postponed
Project:
Simplenews
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Oct 2018 at 13:01 UTC
Updated:
21 Nov 2024 at 13:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anas_maw commentedHaving same issue
Comment #3
adamps commented1) Need to ensure the email is formatted as HTML
Swiftmailer settings allow you to change for every message the site sends: /admin/config/swiftmailer/messages change the message format to HTML and remove respect provided format.
Can do it smarted in hook_mail something like this
2) Need to ensure the HTML doesn't get stripped or escaped.
At the moment you might get lucky because I think the required escaping is missing - see #3031910: Corruption of subscribe mails that look like HTML.
It would be best to add an option to the module to make it work easily.
Comment #4
adamps commentedComment #5
adamps commentedComment #6
adamps commentedComment #7
adamps commentedReroll
Comment #8
nofue commentedUsing SimpleMail on D9, I cannot switch to any text format other than Plain Text on
/admin/config/swiftmailer/messages
I can set 'content type' to HTML, but the 'HTML Format' option list doesn't even show any other options than 'Plain Text'.
Any hints?
Comment #9
adamps commented@nofue Sorry I'm not sure this patch is entirely finished/working yet.
Comment #10
thirstysix commentedSame issue with 3.x-dev with Drupal 9
Problem:
Comment #11
thirstysix commentedSolution:
Reroll patch as per @AdamPS
Working fine with Drupal 9 version
Go to : /admin/config/services/simplenews/settings/subscription
and change the Text format "Full HTML"
Comment #12
thirstysix commentedComment #13
thirstysix commentedupdate version hook_update_830005()
Comment #14
adamps commentedThanks for the patches. Set to "Needs work" as latest patch failed to apply - please can you reroll or fix?
Comment #15
berdirYou guess you meant to this "Needs work" ;)
Comment #16
introfini commentedIn the meantime, others needing to send the email as HTML can use the hook_mail_alter like this:
Comment #17
suresh prabhu parkala commentedRe-rolled patch from #13. Please have a look.
Comment #18
adamps commentedThanks I'll take a look as soon as I get a chance
Comment #19
adamps commentedPatch is good thanks. Next step this needs tests before commit.
I suggest there should be a new test
SimplenewsSubscribeTest::testHtml()something like this.SimplenewsSourceTest::testSendHtml())Comment #20
adamps commentedComment #21
adamps commentedProbably won't fix this - instead plan to move simplenews to use Symfony Mailer module.
Comment #22
jaroslav červený commented#17 little edited for work now.
Comment #23
jaroslav červený commentedComment #24
jocowoodRerolled patch for simplenews 3.0.0-beta4
Problem still exists and the provided patch solves it. Please reconsider a fix!
Comment #25
adamps commentedPlease see #21 - the proposed solution is to use Symfony Mailer, which is now a beta release with 4.5k sites using. Any reason why you can't use it??
Swiftmailer is no longer supported anyway. It doesn't seem to make sense to add features that are only useful in that case. I would like to close this as "won't fix".
Comment #30
sergio.rizo commentedI've made a fork and a merge request (!75) thanks to the patch in comment #24. Tested on Drupal 9.5.11, Simplenews version 4.0.0 and also with the Drupal Symfony Mailer module. This patch solved the problem.
Comment #31
sergio.rizo commentedComment #32
adamps commentedPlease see #21 / #25.