- 🇺🇸United States DamienMcKenna NH, USA
Shouldn't the update script set existing emails to have the old subject of 'Order #@number confirmed'? Also, would it be worth skipping the $this->token->replace() piece if the subject is empty?
/** @var \Drupal\commerce_order\Entity\OrderTypeInterface $order_type */ $order_type = $this->orderTypeStorage->load($order->bundle()); $subject = $order_type->getReceiptSubject(); if (!empty($subject)) { $subject = $this->token->replace($subject, [ 'commerce_order' => $order, ]); } // Provide a default value if the subject line was blank. if (empty($subject)) { $subject = $this->t('Order #@number confirmed', ['@number' => $order->getOrderNumber()]); }
- 🇺🇸United States DamienMcKenna NH, USA
I read through the rest of the changes and understand the direction that was being taken, so the update script works fine.
Here's the minor code change from #17, along with a minor tidying.
- 🇮🇱Israel jsacksick
I don't think this will make it into core TBH. If we start introducing a setting for that, then I guess we should add 50 other settings :).
For site builders not comfortable writing little code to override the order receipt subject, Commerce Email → can be used instead of the default core order receipt email.
The Commerce Email module also lets you customize the content of the email as well.
- 🇺🇸United States DamienMcKenna NH, USA
The decision on what to include vs not include in Commerce is a bit confusing. I would wager the overwhelming majority of sites want emails created as part of the commerce transaction process, so why not have it fully functioning out of the box, including the ability to modify the email subject (this issue)? OTOH the vast majority of sites don't need the ability to create separate stores, but that functionality is built in and mandatory.
- 🇺🇸United States SocialNicheGuru
I assume that you would either use the patch in this issue or "Commerce Email" module not both.
-
jsacksick →
committed 49bcf2ca on 8.x-2.x authored by
lisastreeter →
Issue #2924159 by fenstrat, gmem, DamienMcKenna, lisastreeter, jsacksick...
-
jsacksick →
committed 49bcf2ca on 8.x-2.x authored by
lisastreeter →
- Status changed to Fixed
over 1 year ago 2:58pm 29 March 2023 - 🇮🇱Israel jsacksick
Decided to go ahead and commit a slightly modified version of the patch from comment #18. I actually wondered about getting the token service from the container for people that decorated the Order receipt mail service... But, this alone wouldn't work, so this could potentially be a BC even though I believe people decorating the order receipt mail service shouldn't really extend the base class but rather just implement the interface.
-
jsacksick →
committed cfeb17b7 on 3.0.x authored by
lisastreeter →
Issue #2924159 by fenstrat, gmem, DamienMcKenna, lisastreeter, jsacksick...
-
jsacksick →
committed cfeb17b7 on 3.0.x authored by
lisastreeter →
- 🇮🇱Israel jsacksick
Note that I got rid of the post update function which is unnecessary.
-
jsacksick →
committed deed7007 on 8.x-2.x
Issue #2924159 followup by jsacksick: Properly access the profile view...
-
jsacksick →
committed deed7007 on 8.x-2.x
-
jsacksick →
committed 796a8689 on 3.0.x
Issue #2924159 followup by jsacksick: Properly access the profile view...
-
jsacksick →
committed 796a8689 on 3.0.x
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 5:39am 12 August 2023 - 🇩🇪Germany Anybody Porta Westfalica
@jsacksick trying to translate the subject I just saw that the field was introduced as "string" in the config schema. but must be "label" to be translatable. That's an impediment for multilingual commerce projects. I think it's quite clearly wrong?
Could you perhaps take a look at 🐛 Commerce Order config value receiptSubject ("Subject for the order receipt email") is not translatable Fixed and if the change is clear and fine, merge that?
Thank you in advance! :)