Skip to content

Commit dddc10a

Browse files
Merge pull request #7519 from christianbeeznest/fixes-updates257
Internal: Email: Prefer PNG logos over SVG for better Gmail compatibility
2 parents 9ab86a4 + d52ac50 commit dddc10a

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/CoreBundle/Helpers/ThemeHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ public function getAssetBase64Encoded(string $path): string
230230
*/
231231
public function getPreferredLogoUrl(string $type = 'header', bool $absoluteUrl = false): string
232232
{
233+
// For e-mails, prefer PNG only (Gmail often blocks SVG rendering in emails).
233234
$candidates = 'email' === $type
234-
? ['images/email-logo.svg', 'images/email-logo.png']
235+
? ['images/email-logo.png', 'images/header-logo.png']
235236
: ['images/header-logo.svg', 'images/header-logo.png'];
236237

237238
foreach ($candidates as $relPath) {

src/CoreBundle/Resources/views/Mailer/Default/header.html.twig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
{% set src = theme_logo('email', true) %}
33
{% if not src %}
44
{% set candidates = [
5-
'images/email-logo.svg',
65
'images/email-logo.png',
7-
'images/header-logo.svg',
86
'images/header-logo.png'
97
] %}
108
{% for c in candidates %}

0 commit comments

Comments
 (0)