LegacyEmailBuilder calls hook_mail() too early

Created on 13 May 2022, over 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

When i send order receipt from checkout or from admin page Symfony uses wrong order receipt template.

with symfony mailer this is the output

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'email' -->
<!-- FILE NAME SUGGESTIONS:
   * email--commerce--order-receipt.html.twig
   * email--commerce.html.twig
   x email.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/symfony_mailer/templates/email.html.twig' -->
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'commerce_order' -->
<!-- FILE NAME SUGGESTIONS:
   * commerce-order--1--email.html.twig
   * commerce-order--1.html.twig
   * commerce-order--default--email.html.twig
   * commerce-order--default.html.twig
   * commerce-order--email.html.twig
   x commerce-order.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/commerce/modules/order/templates/commerce-order.html.twig' -->

the twig template is wrong.
with swiftmailer module it works fine. commerce-order-receipt.html.twig is used.

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'swiftmailer' -->
<!-- FILE NAME SUGGESTIONS:
   * swiftmailer--commerce--order-receipt.html.twig
   * swiftmailer--commerce.html.twig
   x swiftmailer.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/swiftmailer/templates/swiftmailer.html.twig' -->
<html>
<head>
<style type="text/css">
table tr td {
  font-family: Arial;
  font-size: 12px;
}
</style>
</head>
<body>
<div>
  <table width="800px" cellpadding="0" cellspacing="0">
    <tr>
      <td>
        <div style="padding: 0px 0px 0px 0px;">
          

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'commerce_order_receipt' -->
<!-- FILE NAME SUGGESTIONS:
   * commerce-order-receipt--default.html.twig
   x commerce-order-receipt.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/commerce/modules/order/templates/commerce-order-receipt.html.twig' -->

thank you

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy trickfun

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024