GARAN label: label image not displayed in the order confirmation mail in common mail clients (base64 SVG data URI)
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 1.2k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 433
Description
### Shopware Version
6.7.14.0 (behaviour unchanged on trunk)
### Affected area / extension
Platform(Default)
### Actual behaviour
The HTML order confirmation mail embeds the nested GARAN label as `` (`sw_garan_label_nested_uri` in `src/Core/Content/Product/Garan/GaranLabelTwigFilter.php`, used in `src/Core/Migration/Fixtures/mails/order_confirmation_mail/*-html.html.twig`).
Many common mail clients do not display images like this:
- **Gmail** (web, iOS, Android) does not display base64 data-URI images at all: https://www.caniemail.com/features/image-base64/
- **Outlook for Windows** 2007–2016 and **Windows Mail** do not display base64 images either (Outlook 2019: partial support). Outlook for Windows 2007–2016 also does not render SVG images: https://www.caniemail.com/features/image-svg/
- **GMX** and **WEB.DE** only partially support base64 images.
In our test the label was not displayed in: GMail
As a result, customers using these clients do not see the label in their order confirmation, although #20519 asks for the label to be shown there. The plain-text version of the mail contains no information about the guarantee.
The fix in #20140 (6.7.15.0) only changes the size of the label. The label is still a data-URI SVG on trunk.
### Expected behaviour
The GARAN label is visible in the HTML order confirmation mail in common mail clients (Gmail, Outlook for Windows, Apple Mail, GMX/WEB.DE) without the customer having to take extra steps.
Possible approach:
- Embed the label as a **PNG inline attachment (CID)** instead of a data URI, e.g. with Symfony Mime `Email::embed()` / `DataPart::asInline()` when the mail is built. Only the duration changes on the nested label (2.5 to 50 years in half-year steps), so the PNGs could be pre-rendered and would not need an SVG renderer on the server.
- A hosted PNG loaded from an absolute URL would work in Gmail. Outlook blocks external images by default, though, so CID embedding seems more reliable.
- Also add a text line (e.g. "Commercial guarantee of durability: 3 years") to the image's alt text and to the plain-text mail, so customers still get the information when images are blocked.
### How to reproduce
1. Use the default order confirmation mail template. If the template has been customised, the migration does not add the label.
2. Create a product with a manufacturer and a manufacturer product number, set the guarantee duration to 36 months and enable "Show label in Storefront".
3. Place an order in the Storefront with a Gmail address, or open the mail in Outlook for Windows.
4. Open the order confirmation mail: the label image under the line item is missing or shown as broken.
Related: #20104, #20140, #20519
Contributor guide
Research direction
Start with src/Core/Content/Product/Garan/GaranLabelTwigFilter.php and the order confirmation templates under src/Core/Migration/Fixtures/mails/order_confirmation_mail/*-html.html.twig, then reproduce the missing label with Gmail or Outlook. Trace how the nested data URI reaches the mail builder and inspect Symfony Mime embedding. Done means the label is visible in common clients and the guarantee information is present in image text and the plain-text mail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend, content
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100