Email ID
This commit is contained in:
@@ -6,9 +6,11 @@ import {
|
||||
Enums,
|
||||
Rechnung,
|
||||
VerbrauchsausweisWohnen,
|
||||
} from "#lib/client/prisma";
|
||||
import { prisma } from "#lib/server/prisma";
|
||||
} from "#lib/client/prisma.js";
|
||||
import { prisma } from "#lib/server/prisma.js";
|
||||
import { getAnsichtsausweis } from "../ausweis.js";
|
||||
import Mail from "nodemailer/lib/mailer/index.js";
|
||||
import { sqids } from "#client/lib/helpers.js";
|
||||
|
||||
export async function sendInvoiceMail(
|
||||
ausweis: VerbrauchsausweisWohnen,
|
||||
@@ -33,7 +35,7 @@ export async function sendInvoiceMail(
|
||||
|
||||
const ausweisart = getAusweisartFromUUID(ausweis.uid);
|
||||
|
||||
const attachments: any[] = [];
|
||||
const attachments: Mail.Attachment[] = [];
|
||||
|
||||
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen) {
|
||||
const ansichtsausweis = await getAnsichtsausweis(
|
||||
@@ -46,15 +48,15 @@ export async function sendInvoiceMail(
|
||||
);
|
||||
|
||||
if (ansichtsausweis) {
|
||||
attachments.push([
|
||||
attachments.push(
|
||||
{
|
||||
filename: "Ansichtsausweis.pdf",
|
||||
filename: `ID_${ausweis.id}_Ansichtsausweis.pdf`,
|
||||
encoding: "binary",
|
||||
content: Buffer.from(ansichtsausweis),
|
||||
contentType: "application/pdf",
|
||||
contentDisposition: "attachment",
|
||||
},
|
||||
]);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +64,7 @@ export async function sendInvoiceMail(
|
||||
attachments,
|
||||
from: `"IBCornelsen" <info@online-energieausweis.org>`,
|
||||
to: user.email,
|
||||
subject: `Bestellbestätigung vom IBCornelsen (ID: ${ausweis.uid})`,
|
||||
subject: `Bestellbestätigung vom IBCornelsen (ID: ${ausweis.id})`,
|
||||
cc: {
|
||||
address: rechnung.email || "",
|
||||
name: rechnung.empfaenger || "",
|
||||
|
||||
Reference in New Issue
Block a user