Update from 1.2 to 1.3 breaks existing order receipt emails

Created on 7 August 2023, 11 months ago
Updated 17 August 2023, 10 months ago

Problem/Motivation

As described in this comment ✨ Full integration with commerce module Fixed , 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.

πŸ› Bug report
Status

Fixed

Version

1.3

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marioki
  • Status changed to Postponed: needs info 11 months ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    Please provide full "steps to reproduce".

    At /admin/config/system/mailer/override you have a choice.

    • If you disable the override for commerce order then it should use the subject and template from commerce.
    • If you enable it, then it should use the Mailer Policy settings from this module, and you should get sensible defaults.

    Please report what state you currently have. You could try to run "reset" or "re-import" and it might fix things.

  • πŸ‡«πŸ‡·France notFloran Reims

    I had the same problem: I had to "enable" the override and then disable it to get everything working properly again

  • Status changed to Active 11 months ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    Thanks

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡­πŸ‡ΊHungary Large64

    Method written in #3 helped. I enabled all overrides then disabled them, everything went back to normal.

  • Status changed to Needs review 11 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 11 months ago
    6 pass
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    OK I think I have a patch (also fixes πŸ› Fresh installations emails broken with 1.3.0 Fixed ). Please can someone test?

  • πŸ‡¨πŸ‡·Costa Rica MaxMendez

    Hi @AdamPS,

    I've tested it in my dev commerce environment and seems that the problem is fixed. Thanks for your work.

  • Status changed to RTBC 11 months ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    Great thanks

    • AdamPS β†’ committed 325d06c6 on 1.x
      Issue #3379690 by AdamPS, notFloran, MaxMendez: Update from 1.2 to 1.3...
  • Status changed to Fixed 11 months ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS
  • πŸ‡ΊπŸ‡ΈUnited States Morbus Iff

    For existing sites, this new functionality is... crazy.

    Whether the DSM override is enabled or not, the DSM module takes over the Commerce Order types UI (admin/commerce/config/order-types/*/edit), so that an admin can no longer set Commerce's native BCC and Subject line fields. When it IS enabled, it seems to create multiple policies (a default one for ALL/ALL, then an imported one for Receipt/orderTypeID) and NEITHER of those show up in the Commerce Order types UI.

    When the DSM override is enabled, the "sensible Body default" seems to use the "current user's permissions" to send out the email, such that an admin testing an order will see *admin-only comments* in the email AND see form controls for adding comments (as an admin would normally see on admin/commerce/orders/#).

    And I've yet to get "have the DSM override enabled, but allow continued use of Commerce's default twig template for the Body". If I delete the Body override element entirely, it somehow still uses the "sensible Body default", sending out the bad unstyled HTML (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). ) with admin comments.

  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    @Morbus Iff Please raise a new issue - what you see seems very strange

    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?

    No

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024