From bc5c73813fa54ab77e5ebe9fc58b658ba68207d4 Mon Sep 17 00:00:00 2001 From: Faisal Ahammad Date: Mon, 10 Aug 2026 13:35:47 +0600 Subject: [PATCH 1/2] fix: add max-width to images in email notifications Constrain avatar and post images in email notifications so large remote avatars no longer render at native size and overflow the screen. Email clients often strip inline styles, so the size is now enforced with width/height attributes on the embed avatar, the new follower icon, and a global max-width rule in the shared email header style block. Fixes #3529 --- .github/changelog/fix/3529-avatar-email-max-width | 4 ++++ templates/emails/new-follower.php | 2 +- templates/emails/parts/header.php | 4 ++++ templates/embed.php | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .github/changelog/fix/3529-avatar-email-max-width diff --git a/.github/changelog/fix/3529-avatar-email-max-width b/.github/changelog/fix/3529-avatar-email-max-width new file mode 100644 index 0000000000..9d36233ff2 --- /dev/null +++ b/.github/changelog/fix/3529-avatar-email-max-width @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fixed oversized avatar and post images in email notifications from remote users. Avatars and inline images now resize to fit the email width instead of overflowing the screen. diff --git a/templates/emails/new-follower.php b/templates/emails/new-follower.php index 4723953117..700a97432d 100644 --- a/templates/emails/new-follower.php +++ b/templates/emails/new-follower.php @@ -81,7 +81,7 @@
- <?php echo esc_attr( $args['name'] ); ?> + <?php echo esc_attr( $args['name'] ); ?>

diff --git a/templates/emails/parts/header.php b/templates/emails/parts/header.php index 6ea7e47185..a68cc59a1e 100644 --- a/templates/emails/parts/header.php +++ b/templates/emails/parts/header.php @@ -36,6 +36,10 @@ margin: 0 !important; } } + img { + max-width: 100%; + height: auto; + } h1 { font-size: 20px; margin-bottom: 16px; diff --git a/templates/embed.php b/templates/embed.php index ebf39e4fac..bf3fef7c39 100644 --- a/templates/embed.php +++ b/templates/embed.php @@ -31,7 +31,7 @@
- +

From 0bf2ae5bf209aec9306cd91566ff4f2b76ad51f3 Mon Sep 17 00:00:00 2001 From: Faisal Ahammad Date: Wed, 12 Aug 2026 15:12:38 +0600 Subject: [PATCH 2/2] fix: constrain embed avatar and featured image in emails - Add inline max-width to the embed avatar so oversized remote avatars stay at 48px even when email clients strip style blocks - Add explicit dimensions to the embed featured image so post images fit the email width instead of overflowing Addresses PR feedback. Refs #3529 --- .github/changelog/fix/3529-avatar-email-max-width | 2 +- templates/embed.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/changelog/fix/3529-avatar-email-max-width b/.github/changelog/fix/3529-avatar-email-max-width index 9d36233ff2..34f9202392 100644 --- a/.github/changelog/fix/3529-avatar-email-max-width +++ b/.github/changelog/fix/3529-avatar-email-max-width @@ -1,4 +1,4 @@ Significance: patch Type: fixed -Fixed oversized avatar and post images in email notifications from remote users. Avatars and inline images now resize to fit the email width instead of overflowing the screen. +Fixed oversized images in email notifications from remote users. Avatars and inline post images now resize to fit the email width instead of overflowing the screen. diff --git a/templates/embed.php b/templates/embed.php index bf3fef7c39..26c705c5ee 100644 --- a/templates/embed.php +++ b/templates/embed.php @@ -31,7 +31,7 @@
- +

@@ -53,7 +53,7 @@
- <?php echo \esc_attr( $image['name'] ?? '' ); ?> + <?php echo \esc_attr( $image['name'] ?? '' ); ?>