Skip to content
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

SVG-logo not displaying in emails due to wrong useSvg flag in html src-code #25984

Closed
maanloper opened this issue Mar 7, 2021 · 4 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity

Comments

@maanloper
Copy link

maanloper commented Mar 7, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Using the 'Theming' settings in the admin-panel, upload a SVG-based logo. (e.g. logo.svg)
  2. Do something to get an email from the server (e.g. login from an unknown location, have someone else share a file with you, etc.)
  3. Check your email client for the mail (I do it using RoundCube, but doesn't matter) -> the logo does not show in the email.
  4. Go to developer view in your browser, and in the following part of the code that loads the logo, change useSvg=0 to useSvg=1:
    src="https://www.yourdomain.tld/apps/theming/image/logo?useSvg=0&v=11"
  5. Now the logo shows

Now I can change this code in developer view of a browser easily, but this needs off course be done on the server side. I'm guessing there is a part of the server-code that handles the emails that doesn't properly check the extension of the logo-files used and/or sets the wrong flag.
If someone can point me in the right direction on how to fix it, I can try to fix it and make my first contribution to Nextcloud :) Thanks!

Edit:
My first guess would be that the problem arises from the following code:
$logoUrl = $this->urlGenerator->getAbsoluteURL($this->themingDefaults->getLogo(false));
in the file server/lib/private/Mail/EMailTemplate.php

To me it seems (but I do not fully understand the workings of the code), that the problem is getLogo(false) instead of getLogo().
Why does it state false? Compatibility with older email systems that do not support svg?

Server configuration

Operating system:
Ubuntu 20.04 LTS

Web server:
Apache

Database:
MariaDB 10.3

PHP version:
7.4

Nextcloud version: (see Nextcloud admin page)
20.0.7.1 (but has been the case since version 15 or so)

Updated from an older Nextcloud/ownCloud or fresh install:
Updated

@maanloper maanloper added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 7, 2021
@maanloper
Copy link
Author

Any updates on this?

@szaimen
Copy link
Contributor

szaimen commented Jul 2, 2021

Hi, do you mind creating a PR with a patch for discussion?
Thank you!

@ghost
Copy link

ghost commented Aug 1, 2021

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Aug 1, 2021
@ghost ghost closed this as completed Aug 15, 2021
@kbzowski
Copy link

This problem is still present in 23.0.0

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

3 participants