Skip to content

stages/email: Only attach logo to email if used#14835

Merged
BeryJu merged 4 commits intogoauthentik:mainfrom
chriselsen:email-attachment-fix
Jun 9, 2025
Merged

stages/email: Only attach logo to email if used#14835
BeryJu merged 4 commits intogoauthentik:mainfrom
chriselsen:email-attachment-fix

Conversation

@chriselsen
Copy link
Contributor

@chriselsen chriselsen commented Jun 3, 2025

Details

Address #8397 by only attaching the logo file to an email only when that logo is used in the mailed template via MIME embedded files.
If user modify the template and do not use the logo (e.g. remove it or reference logos via https://...) the logo is not attached.

Makes sure that if the logo is used, the MIME attachment conforms to standards:

  • content-id is an actual ID and not a file name
  • content-disposition is correctly set to inline

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

@netlify
Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit ee04b8c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/684636f2e911a9000870f695
😎 Deploy Preview https://deploy-preview-14835--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit ee04b8c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/684636f2cb88bb0008dcebf1
😎 Deploy Preview https://deploy-preview-14835--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chriselsen chriselsen marked this pull request as ready for review June 3, 2025 07:02
@chriselsen chriselsen requested a review from a team as a code owner June 3, 2025 07:02
@chriselsen chriselsen changed the title Only attach logo to email if used stages/email: Only attach logo to email if used Jun 4, 2025
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu requested a review from a team as a code owner June 9, 2025 01:19
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu
Copy link
Member

BeryJu commented Jun 9, 2025

/cherry-pick version-2025.6

@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.79%. Comparing base (fb2401c) to head (ee04b8c).
Report is 96 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14835      +/-   ##
==========================================
+ Coverage   92.75%   92.79%   +0.03%     
==========================================
  Files         817      818       +1     
  Lines       42197    42199       +2     
==========================================
+ Hits        39141    39158      +17     
+ Misses       3056     3041      -15     
Flag Coverage Δ
e2e 47.72% <100.00%> (+0.16%) ⬆️
integration 24.44% <0.00%> (+0.06%) ⬆️
unit 90.68% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BeryJu BeryJu merged commit 652a32d into goauthentik:main Jun 9, 2025
96 of 98 checks passed
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Jun 9, 2025
* Only attach logo to email if used

* Fix MIME logo attachment to adhere to standard

* format, fix web

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* not tuple

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit that referenced this pull request Jun 9, 2025
…14969)

stages/email: Only attach logo to email if used (#14835)

* Only attach logo to email if used

* Fix MIME logo attachment to adhere to standard

* format, fix web



* not tuple



---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Christian Elsen <chriselsen@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
kensternberg-authentik added a commit that referenced this pull request Jun 9, 2025
* main: (38 commits)
  website/docs: added a link in our Upgrade docs to the Outpost upgrade docs, slight reformatting  (#14931)
  website: fix search across multiple subdomains (#14976)
  core: bump goauthentik.io/api/v3 from 3.2025060.1 to 3.2025061.1 (#14972)
  web: bump API Client version (#14971)
  root: backport 2025.6.1 bump (#14970)
  stages/email: Only attach logo to email if used (#14835)
  web: bump @codemirror/lang-python from 6.1.6 to 6.2.1 in /web (#14713)
  website: bump prettier-plugin-packagejson from 2.5.14 to 2.5.15 in /website (#14829)
  core: bump selenium/standalone-chrome from 136.0 to 137.0 in /tests/e2e (#14963)
  core: bump axllent/mailpit from v1.25.1 to v1.26.0 in /tests/e2e (#14964)
  core: bump astral-sh/uv from 0.7.11 to 0.7.12 (#14965)
  core: bump github.com/redis/go-redis/v9 from 9.9.0 to 9.10.0 (#14966)
  web: bump @types/mocha from 10.0.8 to 10.0.10 in /web (#14684)
  web: bump ts-pattern from 5.4.0 to 5.7.1 in /web (#14686)
  website: bump @types/node from 22.15.29 to 22.15.30 in /website (#14968)
  web: bump mermaid from 11.4.1 to 11.6.0 in /web (#14688)
  web: bump @fortawesome/fontawesome-free from 6.6.0 to 6.7.2 in /web (#14716)
  web: bump the eslint group across 2 directories with 3 updates (#14833)
  website: bump the eslint group in /website with 4 updates (#14967)
  website: bump @typescript-eslint/parser from 8.32.1 to 8.33.1 in /website (#14828)
  ...
cavefire pushed a commit to cavefire/authentik that referenced this pull request Jun 24, 2025
* Only attach logo to email if used

* Fix MIME logo attachment to adhere to standard

* format, fix web

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* not tuple

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants