-
-
Notifications
You must be signed in to change notification settings - Fork 530
Email logo to png extension #16779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x
Are you sure you want to change the base?
Email logo to png extension #16779
Conversation
| $this->setPlaceholder('background', $background); | ||
|
|
||
| $logo = $this->modx->getOption('login_logo', null, $managerUrl . 'templates/' . $managerTheme . '/images/modx-logo-color.svg', true); | ||
| $logo = $this->modx->getOption('login_logo', null, $managerUrl . 'templates/' . $managerTheme . '/images/modx-logo-color.png', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the wrong place to change this, as this is for the web UI not the email html. You need to alter the email template at manager/templates/default/email/default.tpl. But, it'd be preferable to provide the png as a fallback to the svg, maybe trying something like:
<img
src="{$_config.url_scheme}{$_config.http_host}{$_config.manager_url}templates/default/images/modx-logo-color.png"
alt="{$_config.site_name}"
srcset="{$_config.url_scheme}{$_config.http_host}{$_config.manager_url}templates/default/images/modx-logo-color.svg"
>I'd also suggest providing the PNG at a minimum of 2x size (~440px wide), maybe even 3x (~650px). It's sized down in the css, so no worries on physical size; this will give it a sharper appearance on the mostly high-dpi devices the message will be read with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $this->setPlaceholder('background', $background); | ||
|
|
||
| $logo = $this->modx->getOption('login_logo', null, $managerUrl . 'templates/' . $managerTheme . '/images/modx-logo-color.svg', true); | ||
| $logo = $this->modx->getOption('login_logo', null, $managerUrl . 'templates/' . $managerTheme . '/images/modx-logo-color.png', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it do?
I changed the extension from .svg to .png and uploaded a new png logo
Why is it needed?
Some email providers for example Gmail are blocking .svg images in their email. So the image won't load if you view it in gmail.
How to test
Use the "Let the user choose their own password via email" option for example and check the email in gmail. The image won't load