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 images in emails generated by plugin do not render in gmail client #558

Closed
gamerson opened this issue Mar 7, 2022 · 9 comments · Fixed by #853
Closed

SVG images in emails generated by plugin do not render in gmail client #558

gamerson opened this issue Mar 7, 2022 · 9 comments · Fixed by #853
Labels
bug Something isn't working

Comments

@gamerson
Copy link

gamerson commented Mar 7, 2022

Describe the bug
When sonarqube generates a new PR comment via this plugin and posts it to a github PR, it renders the SVGs correct in the github UI. However, when that same comment is viewed in gmail web UI, the svg images appear broken (see attached screenshot).

To Reproduce
Steps to reproduce the behavior:

  1. View a analysis summary comment posted to github PR in gmails web UI

Expected behavior
The SVG images will be displayed instead of borken.

Software Versions

  • sonarqube-community-branch-plugin Docker image 8.9-community

Here is screenshot of a github PR comment in github web UI:
Screen Shot 2022-03-07 at 11 10 51 AM

Here is screenshot of the content when viewed in gmail.

Screen Shot 2022-03-07 at 11 05 19 AM

@gamerson gamerson added the bug Something isn't working label Mar 7, 2022
@gamerson gamerson changed the title SVG images in emails generated by plugin do not render in gmail UI SVG images in emails generated by plugin do not render in gmail client Mar 7, 2022
@gamerson
Copy link
Author

gamerson commented Mar 7, 2022

Could this be because of this issue? https://stackoverflow.com/questions/20815613/svg-images-blocked-by-gmail-proxy

@mc1arke
Copy link
Owner

mc1arke commented Apr 4, 2022

Yes, this issue is actually a restriction in the way Gmail works. I'm happy for someone to raise a PR against the plugin to support other image types if this is critical to them, but I have no plans on changing this myself.

@mc1arke mc1arke closed this as completed Apr 4, 2022
@gamerson
Copy link
Author

gamerson commented Apr 5, 2022 via email

@mc1arke
Copy link
Owner

mc1arke commented Apr 5, 2022

You'd need to add the new icons to the plugin, and then update the references in the AnalysisDetails class to use the new files. Sonarsource's distributed images can be found at https://github.com/SonarSource/sonarcloud-github-static-resources and would be safe to copy given the common license between those files and the plugin.

@nkelemen18
Copy link
Contributor

Yes, this issue is actually a restriction in the way Gmail works. I'm happy for someone to raise a PR against the plugin to support other image types if this is critical to them, but I have no plans on changing this myself.

I opened a PR for this: #721

@nkelemen18
Copy link
Contributor

@mc1arke Could you check the PR if there is something, I should improve?

@gamerson
Copy link
Author

Hey @nkelemen18 I have tried your change in #721 but unfortunately even the PNG images will not display in a github PR comment in either github UI or in gmail email display. I think it just don't want to load images from random domains. I'm starting to consider an emoji may be a better recourse here, what do you think?

@nkelemen18
Copy link
Contributor

Hello all,

Sorry for my late reply I had other stuffs to do.

Based on comments here, and on my previous PR (#721) I refactored my previous work to use PNGs only.

The new PR: #853.

@gamerson You asked what is the reason behind generating pngs from svgs instead of using the images from the original plugin.
My answer is: Some images missing from the original plugin which are used by this one.

@gamerson
Copy link
Author

gamerson commented Jan 4, 2024 via email

mc1arke pushed a commit that referenced this issue Mar 16, 2024
Some email clients block the loading of SVG images,
resulting in the summary reports not displaying 
cleanly. PNG equivalents of those images has been
generated and the report generation switched to use
them. The old SVG images have been retained to 
ensure that existing reports continue to render
where possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants