Repository navigation
fix(email): Link email images to a stable URL - #133341
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Email images used the versioned STATIC_URL. The static bucket deletes objects 60 days after upload, so images in older emails break. Add STATIC_STABLE_IMAGES_URL and an absolute_stable_image_url tag that point at images published under an unversioned path, and use them for every image in email templates and the email avatar. When the setting is unset, the tag falls back to the versioned asset URL, so self-hosted is unchanged. Co-Authored-By: Grant Patterson <82265+hobzcalvin@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Images in older emails break. Email templates link images through
absolute_asset_url, which buildsSTATIC_URL,/_static/<media_version>/…. In SaaS that iss1.sentry-cdn.com, backed by thesentryio-staticbucket, which deletes every object 60 days after upload. Every deploy publishes a new media version, so an email's images disappear about 60 days after the deploy it was rendered on.This adds a
STATIC_STABLE_IMAGES_URLsetting and anabsolute_stable_image_urltemplate tag (backed byget_stable_image_url). They build<STATIC_STABLE_IMAGES_URL>/<module>/images/…, a URL that stays the same across deploys. Every image insentry/emails/templates now uses the tag, including the{% static %}integration logos, which also rendered relative URLs in self-hosted. The Sentry email avatar uses it too.get_stable_image_urlonly acceptsimages/paths, because only<module>/images/is published under the stable prefix.When the setting is unset, the tag falls back to the versioned asset URL, so self-hosted output does not change.
Follow-ups that set the setting and publish the images:
<module>/images/to_stable/on every deploy and setsSTATIC_STABLE_IMAGES_URL._stable/.getsentry's email templates switch to the new tag in its PR, so this one has to merge first.
via @hobzcalvin.
--
View Session [Sentry]