Allow separate from and to emails
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 10s
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 10s
This commit is contained in:
@ -22,6 +22,8 @@ SMTP_HOST=smtp.example.com
|
||||
SMTP_PORT=465
|
||||
SMTP_SECURE=true
|
||||
SMTP_USER=noreply@example.com
|
||||
EMAIL_FROM=noreply@example.com
|
||||
EMAIL_TO=email@example.com
|
||||
SMTP_PASSWORD=password
|
||||
|
||||
DOMAIN=example.com
|
||||
|
@ -10,6 +10,8 @@ SMTP_HOST=smtp.example.com
|
||||
SMTP_PORT=465
|
||||
SMTP_SECURE=true
|
||||
SMTP_USER=noreply@example.com
|
||||
EMAIL_FROM=noreply@example.com
|
||||
EMAIL_TO=email@example.com
|
||||
SMTP_PASSWORD=password
|
||||
|
||||
DOMAIN=example.com
|
||||
|
@ -48,6 +48,8 @@ ARG SMTP_PORT
|
||||
ARG SMTP_SECURE
|
||||
ARG SMTP_USER
|
||||
ARG SMTP_PASSWORD
|
||||
ARG EMAIL_FROM
|
||||
ARG EMAIL_TO
|
||||
ARG FIRST_NAME
|
||||
ARG LAST_NAME
|
||||
|
||||
|
@ -28,6 +28,8 @@ services:
|
||||
- SMTP_PORT=465
|
||||
- SMTP_SECURE=true
|
||||
- SMTP_USER=noreply@example.com
|
||||
- EMAIL_FROM=noreply@example.com
|
||||
- EMAIL_TO=email@example.com
|
||||
- SMTP_PASSWORD=password
|
||||
- DOMAIN=portfolio.example.com
|
||||
- API_DOMAIN=api.portfolio.example.com
|
||||
|
@ -19,7 +19,7 @@ const transporter = nodemailer.createTransport({
|
||||
|
||||
export const sendEmail = async ({ to, subject, text, html }: Options) =>
|
||||
await transporter.sendMail({
|
||||
from: `${process.env.FIRST_NAME} ${process.env.LAST_NAME} <${process.env.GMAIL}>`,
|
||||
from: `${process.env.FIRST_NAME} ${process.env.LAST_NAME} <${process.env.EMAIL_FROM}>`,
|
||||
to: Array.isArray(to) ? to : [to],
|
||||
subject,
|
||||
text,
|
||||
|
@ -16,6 +16,8 @@ services:
|
||||
- SMTP_PORT=465
|
||||
- SMTP_SECURE=true
|
||||
- SMTP_USER=noreply@example.com
|
||||
- EMAIL_FROM=noreply@example.com
|
||||
- EMAIL_TO=email@example.com
|
||||
- SMTP_PASSWORD=password
|
||||
- DOMAIN=portfolio.example.com
|
||||
- API_DOMAIN=api.portfolio.example.com
|
||||
|
@ -9,7 +9,7 @@ export default async () => {
|
||||
try {
|
||||
const admin = {
|
||||
username: 'admin',
|
||||
email: process.env.GMAIL,
|
||||
email: process.env.EMAIL_TO,
|
||||
password: process.env.SMTP_PASSWORD,
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ export default async () => {
|
||||
|
||||
const existingAdmin = await db.user.findFirst({
|
||||
where: {
|
||||
email: admin.email,
|
||||
username: admin.username,
|
||||
},
|
||||
})
|
||||
|
||||
@ -30,6 +30,14 @@ export default async () => {
|
||||
salt,
|
||||
},
|
||||
})
|
||||
else
|
||||
await db.user.update({
|
||||
where: { id: existingAdmin.id },
|
||||
data: {
|
||||
username: admin.username,
|
||||
email: admin.email,
|
||||
},
|
||||
})
|
||||
|
||||
const titles = await db.titles.findFirst()
|
||||
|
||||
|
Reference in New Issue
Block a user