mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(login): add local users functionality (#591)
This commit is contained in:
38
server/lib/email/index.ts
Normal file
38
server/lib/email/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import Email from 'email-templates';
|
||||
import { getSettings } from '../settings';
|
||||
class PreparedEmail extends Email {
|
||||
public constructor() {
|
||||
const settings = getSettings().notifications.agents.email;
|
||||
|
||||
const transport = nodemailer.createTransport({
|
||||
host: settings.options.smtpHost,
|
||||
port: settings.options.smtpPort,
|
||||
secure: settings.options.secure,
|
||||
tls: settings.options.allowSelfSigned
|
||||
? {
|
||||
rejectUnauthorized: false,
|
||||
}
|
||||
: undefined,
|
||||
auth:
|
||||
settings.options.authUser && settings.options.authPass
|
||||
? {
|
||||
user: settings.options.authUser,
|
||||
pass: settings.options.authPass,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
super({
|
||||
message: {
|
||||
from: {
|
||||
name: settings.options.senderName,
|
||||
address: settings.options.emailFrom,
|
||||
},
|
||||
},
|
||||
send: true,
|
||||
transport: transport,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default PreparedEmail;
|
Reference in New Issue
Block a user