mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(email): do not attempt to display logo if app URL not configured (#2125)
* fix(email): do not attempt to display logo if app URL not configured * fix(email): prevent Gmail from turning usernames with periods into hyperlinks * fix(email): fix(email): use displayName instead of username/plexUserName and improve Gmail link fix
This commit is contained in:
@@ -46,7 +46,8 @@ class EmailAgent
|
||||
private buildMessage(
|
||||
type: Notification,
|
||||
payload: NotificationPayload,
|
||||
toEmail: string
|
||||
recipientEmail: string,
|
||||
recipientName?: string
|
||||
): EmailOptions | undefined {
|
||||
const { applicationUrl, applicationTitle } = getSettings().main;
|
||||
|
||||
@@ -54,12 +55,14 @@ class EmailAgent
|
||||
return {
|
||||
template: path.join(__dirname, '../../../templates/email/test-email'),
|
||||
message: {
|
||||
to: toEmail,
|
||||
to: recipientEmail,
|
||||
},
|
||||
locals: {
|
||||
body: payload.message,
|
||||
applicationUrl,
|
||||
applicationTitle,
|
||||
recipientName,
|
||||
recipientEmail,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -127,7 +130,7 @@ class EmailAgent
|
||||
'../../../templates/email/media-request'
|
||||
),
|
||||
message: {
|
||||
to: toEmail,
|
||||
to: recipientEmail,
|
||||
},
|
||||
locals: {
|
||||
requestType,
|
||||
@@ -143,6 +146,8 @@ class EmailAgent
|
||||
: undefined,
|
||||
applicationUrl,
|
||||
applicationTitle,
|
||||
recipientName,
|
||||
recipientEmail,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -179,7 +184,12 @@ class EmailAgent
|
||||
payload.notifyUser.settings?.pgpKey
|
||||
);
|
||||
await email.send(
|
||||
this.buildMessage(type, payload, payload.notifyUser.email)
|
||||
this.buildMessage(
|
||||
type,
|
||||
payload,
|
||||
payload.notifyUser.email,
|
||||
payload.notifyUser.displayName
|
||||
)
|
||||
);
|
||||
} catch (e) {
|
||||
logger.error('Error sending email notification', {
|
||||
@@ -228,7 +238,9 @@ class EmailAgent
|
||||
this.getSettings(),
|
||||
user.settings?.pgpKey
|
||||
);
|
||||
await email.send(this.buildMessage(type, payload, user.email));
|
||||
await email.send(
|
||||
this.buildMessage(type, payload, user.email, user.displayName)
|
||||
);
|
||||
} catch (e) {
|
||||
logger.error('Error sending email notification', {
|
||||
label: 'Notifications',
|
||||
|
Reference in New Issue
Block a user