Problem/Motivation
As described in this comment, the code that is now in version 1.3, integrating the commerce order receipt breaks emails that were styled with the commerce-order-receipt.html.twig template. In my case by default this even resulted in emails with empty subjects and the rendered order (commerce-order.html.twig) as the body.
Solution: default to the commerce-order-receipt template if no body is set and default to the subject provided by the commerce order setting if empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | symfony_mailer.emails-broken.3380197-11.patch | 643 bytes | adamps |
Comments
Comment #2
adamps commentedPlease provide full "steps to reproduce".
At /admin/config/system/mailer/override you have a choice.
Please report what state you currently have. You could try to run "reset" or "re-import" and it might fix things.
Comment #3
notfloran commentedI had the same problem: I had to "enable" the override and then disable it to get everything working properly again
Comment #4
adamps commentedThanks
Comment #5
anybodyComment #6
large64 commentedMethod written in #3 helped. I enabled all overrides then disabled them, everything went back to normal.
Comment #7
adamps commentedOK I think I have a patch (also fixes #3380197: Fresh installations emails broken with 1.3.0). Please can someone test?
Comment #8
maxmendez commentedHi @AdamPS,
I've tested it in my dev commerce environment and seems that the problem is fixed. Thanks for your work.
Comment #9
adamps commentedGreat thanks
Comment #11
adamps commentedComment #12
morbus iffFor existing sites, this new functionality is... crazy.
When the DSM override is enabled, the "sensible Body default" seems to use an "admin user's permissions" to send out the email, such that a normal user will see *admin-only comments* in the email (when the Commerce order template would send no comments at all). An admin user testing an order sees these admin-only comments AND form controls for adding comments (as an admin would normally see on admin/commerce/orders/#) AND order status-changing buttons.
And I've yet to get "have the DSM override enabled, but allow continued use of Commerce's default twig template for the Body" to work. Is it supposed to? I thought I had read something like that in the previous issue. If I delete the Body override element entirely, it somehow still uses the "sensible Body default", sending out the bad unstyled HTML and admin-only comments (unstyled caused by another issue: Warning: file_get_contents(default/files/css/css_I5WrM2XNc4EO21P353X1Tp3NJ4d0oh87oqBOCBGEP18.css?delta=0&language=en&theme=edv_bootstrap&include=eJxLTSmLT8rPLykuKUos0E_NTczM0SmuzE3Lz6uMB3FSi_ST83NzU4uSU-Pzi1JSiwDuVRPD): Failed to open stream: No such file or directory in Drupal\symfony_mailer\Plugin\EmailAdjuster\InlineCssEmailAdjuster->postRender() (line 78 of modules/contrib/symfony_mailer/src/Plugin/EmailAdjuster/InlineCssEmailAdjuster.php). ).
Comment #13
adamps commented@Morbus Iff Please raise a new issue - what you see seems very strange
No