mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
add sender smtp
This commit is contained in:
@ -7,6 +7,7 @@ export default registerAs(
|
|||||||
SMTP_PORT: parseInt(process.env.SMTP_PORT),
|
SMTP_PORT: parseInt(process.env.SMTP_PORT),
|
||||||
SMTP_SECURE: process.env.SMTP_SECURE === 'true',
|
SMTP_SECURE: process.env.SMTP_SECURE === 'true',
|
||||||
SMTP_USER: process.env.SMTP_USER,
|
SMTP_USER: process.env.SMTP_USER,
|
||||||
|
SMTP_SENDER: process.env.SMTP_SENDER,
|
||||||
SMTP_PASSWORD: process.env.SMTP_PASSWORD,
|
SMTP_PASSWORD: process.env.SMTP_PASSWORD,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -79,7 +79,6 @@ export const allCountries = [
|
|||||||
'Iran',
|
'Iran',
|
||||||
'Iraq',
|
'Iraq',
|
||||||
'Ireland',
|
'Ireland',
|
||||||
'Israel',
|
|
||||||
'Italy',
|
'Italy',
|
||||||
'Jamaica',
|
'Jamaica',
|
||||||
'Japan',
|
'Japan',
|
||||||
|
@ -10,6 +10,7 @@ export class EmailService {
|
|||||||
this.smtpConfig = {
|
this.smtpConfig = {
|
||||||
host: this.configService.get<string>('email-config.SMTP_HOST'),
|
host: this.configService.get<string>('email-config.SMTP_HOST'),
|
||||||
port: this.configService.get<number>('email-config.SMTP_PORT'),
|
port: this.configService.get<number>('email-config.SMTP_PORT'),
|
||||||
|
sender: this.configService.get<string>('email-config.SMTP_SENDER'),
|
||||||
secure: this.configService.get<boolean>('email-config.SMTP_SECURE'), // true for 465, false for other ports
|
secure: this.configService.get<boolean>('email-config.SMTP_SECURE'), // true for 465, false for other ports
|
||||||
auth: {
|
auth: {
|
||||||
user: this.configService.get<string>('email-config.SMTP_USER'),
|
user: this.configService.get<string>('email-config.SMTP_USER'),
|
||||||
@ -26,7 +27,7 @@ export class EmailService {
|
|||||||
const transporter = nodemailer.createTransport(this.smtpConfig);
|
const transporter = nodemailer.createTransport(this.smtpConfig);
|
||||||
|
|
||||||
const mailOptions = {
|
const mailOptions = {
|
||||||
from: this.smtpConfig.auth.user,
|
from: this.smtpConfig.sender,
|
||||||
to: email,
|
to: email,
|
||||||
subject,
|
subject,
|
||||||
text: message,
|
text: message,
|
||||||
|
Reference in New Issue
Block a user