Skip to content

Commit c0fe5aa

Browse files
committed
Add support for public seerr logo in email
1 parent 92c486d commit c0fe5aa

8 files changed

Lines changed: 57 additions & 9 deletions

File tree

server/lib/notifications/agents/email.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import { Notification, shouldSendAdminNotification } from '..';
1616
import type { NotificationAgent, NotificationPayload } from './agent';
1717
import { BaseAgent } from './agent';
1818

19+
const PUBLIC_LOGO_URL =
20+
'https://raw.githubusercontent.com/seerr-team/seerr/refs/heads/develop/public/logo_full.svg';
21+
1922
const messages = defineMessages('notifications.agents.email', {
2023
issueType: '{type} issue',
2124
issue: 'issue',
@@ -96,6 +99,12 @@ class EmailAgent
9699
const settings = getSettings();
97100
const { applicationUrl, applicationTitle } = settings.main;
98101
const { embedPoster } = settings.notifications.agents.email;
102+
const { usePublicLogo } = settings.notifications.agents.email.options;
103+
const logoUrl = usePublicLogo
104+
? PUBLIC_LOGO_URL
105+
: applicationUrl
106+
? `${applicationUrl}/logo_full.png`
107+
: undefined;
99108

100109
if (type === Notification.TEST_NOTIFICATION) {
101110
return {
@@ -107,6 +116,7 @@ class EmailAgent
107116
body: payload.message,
108117
applicationUrl,
109118
applicationTitle,
119+
logoUrl,
110120
recipientName,
111121
recipientEmail,
112122
},
@@ -195,6 +205,7 @@ class EmailAgent
195205
: undefined,
196206
applicationUrl,
197207
applicationTitle,
208+
logoUrl,
198209
recipientName,
199210
recipientEmail,
200211
},
@@ -263,6 +274,7 @@ class EmailAgent
263274
: undefined,
264275
applicationUrl,
265276
applicationTitle,
277+
logoUrl,
266278
recipientName,
267279
recipientEmail,
268280
},

server/lib/settings/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export interface NotificationAgentEmail extends NotificationAgentConfig {
255255
authPass?: string;
256256
allowSelfSigned: boolean;
257257
senderName: string;
258+
usePublicLogo: boolean;
258259
pgpPrivateKey?: string;
259260
pgpPassword?: string;
260261
};
@@ -472,6 +473,7 @@ class Settings {
472473
requireTls: false,
473474
allowSelfSigned: false,
474475
senderName: 'Seerr',
476+
usePublicLogo: false,
475477
},
476478
},
477479
discord: {

server/templates/email/media-issue/html.pug

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ div(style='display: block; background-color: #111827; padding: 2.5rem 0;')
1919
table(style='margin: 0 auto; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif; color: #fff; font-size: 16px; width: 26rem;')
2020
tr
2121
td(style="text-align: center;")
22-
if applicationUrl
23-
a(href=applicationUrl style='margin: 0 1rem;')
24-
img(src=applicationUrl +'/logo_full.png' style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
22+
if logoUrl
23+
if applicationUrl
24+
a(href=applicationUrl style='margin: 0 1rem;')
25+
img(src=logoUrl style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
26+
else
27+
img(src=logoUrl style='margin: 0 1rem; width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
2528
else
2629
div(style='margin: 0 1rem 2.5rem; font-size: 3em; font-weight: 700;')
2730
| #{applicationTitle}

server/templates/email/media-request/html.pug

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ div(style='display: block; background-color: #111827; padding: 2.5rem 0;')
1919
table(style='margin: 0 auto; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif; color: #fff; font-size: 16px; width: 26rem;')
2020
tr
2121
td(style="text-align: center;")
22-
if applicationUrl
23-
a(href=applicationUrl style='margin: 0 1rem;')
24-
img(src=applicationUrl +'/logo_full.png' style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
22+
if logoUrl
23+
if applicationUrl
24+
a(href=applicationUrl style='margin: 0 1rem;')
25+
img(src=logoUrl style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
26+
else
27+
img(src=logoUrl style='margin: 0 1rem; width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
2528
else
2629
div(style='margin: 0 1rem 2.5rem; font-size: 3em; font-weight: 700;')
2730
| #{applicationTitle}

server/templates/email/test-email/html.pug

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ div(style='display: block; background-color: #111827; padding: 2.5rem 0;')
1919
table(style='margin: 0 auto; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif; color: #fff; font-size: 16px; width: 26rem;')
2020
tr
2121
td(style="text-align: center;")
22-
if applicationUrl
23-
a(href=applicationUrl style='margin: 0 1rem;')
24-
img(src=applicationUrl +'/logo_full.png' style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
22+
if logoUrl
23+
if applicationUrl
24+
a(href=applicationUrl style='margin: 0 1rem;')
25+
img(src=logoUrl style='width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
26+
else
27+
img(src=logoUrl style='margin: 0 1rem; width: 26rem; image-rendering: crisp-edges; image-rendering: -webkit-optimize-contrast;')
2528
else
2629
div(style='margin: 0 1rem 2.5rem; font-size: 3em; font-weight: 700;')
2730
| #{applicationTitle}

src/components/Settings/Notifications/NotificationsEmail.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const messages = defineMessages('components.Settings.Notifications', {
1919
validationSmtpPortRequired: 'You must provide a valid port number',
2020
agentenabled: 'Enable Agent',
2121
embedPoster: 'Embed Poster',
22+
usePublicLogo: 'Use public Seerr logo instead of instance logo',
23+
usePublicLogoTip:
24+
'If your Seerr instance is not publicly accessible, enable this option so email clients outside your network can display the image. The image will be pulled from the public GitHub repository.',
2225
userEmailRequired: 'Require user email',
2326
emailsender: 'Sender Address',
2427
smtpHost: 'SMTP Host',
@@ -134,6 +137,7 @@ const NotificationsEmail = () => {
134137
initialValues={{
135138
enabled: data.enabled,
136139
embedPoster: data.embedPoster,
140+
usePublicLogo: data.options.usePublicLogo,
137141
userEmailRequired: data.options.userEmailRequired,
138142
emailFrom: data.options.emailFrom,
139143
smtpHost: data.options.smtpHost,
@@ -160,6 +164,7 @@ const NotificationsEmail = () => {
160164
embedPoster: values.embedPoster,
161165
options: {
162166
userEmailRequired: values.userEmailRequired,
167+
usePublicLogo: values.usePublicLogo,
163168
emailFrom: values.emailFrom,
164169
smtpHost: values.smtpHost,
165170
smtpPort: Number(values.smtpPort),
@@ -209,6 +214,7 @@ const NotificationsEmail = () => {
209214
enabled: true,
210215
embedPoster: values.embedPoster,
211216
options: {
217+
usePublicLogo: values.usePublicLogo,
212218
emailFrom: values.emailFrom,
213219
smtpHost: values.smtpHost,
214220
smtpPort: Number(values.smtpPort),
@@ -263,6 +269,21 @@ const NotificationsEmail = () => {
263269
<Field type="checkbox" id="embedPoster" name="embedPoster" />
264270
</div>
265271
</div>
272+
<div className="form-row">
273+
<label htmlFor="usePublicLogo" className="checkbox-label">
274+
{intl.formatMessage(messages.usePublicLogo)}
275+
<span className="label-tip">
276+
{intl.formatMessage(messages.usePublicLogoTip)}
277+
</span>
278+
</label>
279+
<div className="form-input-area">
280+
<Field
281+
type="checkbox"
282+
id="usePublicLogo"
283+
name="usePublicLogo"
284+
/>
285+
</div>
286+
</div>
266287
<div className="form-row">
267288
<label htmlFor="userEmailRequired" className="checkbox-label">
268289
{intl.formatMessage(messages.userEmailRequired)}

src/i18n/locale/de.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@
516516
"components.Settings.Notifications.senderName": "Absendername",
517517
"components.Settings.Notifications.smtpHost": "SMTP-Host",
518518
"components.Settings.Notifications.smtpPort": "SMTP-Port",
519+
"components.Settings.Notifications.usePublicLogo": "Öffentliches Seerr-Logo statt Logo von der Instanz verwenden",
520+
"components.Settings.Notifications.usePublicLogoTip": "Wenn deine Seerr-Instanz nicht öffentlich erreichbar ist, aktiviere diese Option, damit E-Mail-Clients außerhalb deines Netzwerks das Bild anzeigen können. Das Bild wird aus dem öffentlichen GitHub-Repository geladen.",
519521
"components.Settings.Notifications.telegramsettingsfailed": "Telegram-Benachrichtigungseinstellungen konnten nicht gespeichert werden.",
520522
"components.Settings.Notifications.telegramsettingssaved": "Telegram-Benachrichtigungseinstellungen erfolgreich gespeichert!",
521523
"components.Settings.Notifications.toastDiscordTestFailed": "Discord Testbenachrichtigung fehlgeschlagen.",

src/i18n/locale/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@
775775
"components.Settings.Notifications.toastTelegramTestFailed": "Telegram test notification failed to send.",
776776
"components.Settings.Notifications.toastTelegramTestSending": "Sending Telegram test notification…",
777777
"components.Settings.Notifications.toastTelegramTestSuccess": "Telegram test notification sent!",
778+
"components.Settings.Notifications.usePublicLogo": "Use public Seerr logo instead of instance logo",
779+
"components.Settings.Notifications.usePublicLogoTip": "If your Seerr instance is not publicly accessible, enable this option so email clients outside your network can display the image. The image will be pulled from the public GitHub repository.",
778780
"components.Settings.Notifications.useUserLocale": "Use Notification Recipient Locale",
779781
"components.Settings.Notifications.userEmailRequired": "Require user email",
780782
"components.Settings.Notifications.validationBotAPIRequired": "You must provide a bot authorization token",

0 commit comments

Comments
 (0)