Bedarfsausweis gewerbe

This commit is contained in:
Moritz Utcke
2025-03-12 18:14:13 -03:00
parent 5f5cdc5728
commit 00015b30cd
32 changed files with 1182 additions and 108 deletions

View File

@@ -8,8 +8,8 @@ import {
} from "#lib/client/prisma.js";
import { prisma } from "#lib/server/prisma.js";
import { getAnsichtsausweis } from "../ausweis.js";
import { sqids } from "#client/lib/helpers.js";
import Mail from "nodemailer/lib/mailer/index.js";
import { shortenUID } from "#server/lib/hash.js";
export async function sendPaymentSuccessMail(
ausweis: VerbrauchsausweisWohnen,
@@ -34,6 +34,8 @@ export async function sendPaymentSuccessMail(
const ausweisart = getAusweisartFromUUID(ausweis.uid);
const attachments: Mail.Attachment[] = [];
const id = shortenUID(ausweis.uid)
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen) {
const ansichtsausweis = await getAnsichtsausweis(
ausweis,
@@ -47,7 +49,7 @@ export async function sendPaymentSuccessMail(
if (ansichtsausweis) {
attachments.push(
{
filename: `ID_${ausweis.id}_Ansichtsausweis.pdf`,
filename: `ID_${id}_Ansichtsausweis.pdf`,
encoding: "binary",
content: Buffer.from(ansichtsausweis),
contentType: "application/pdf",
@@ -66,7 +68,7 @@ export async function sendPaymentSuccessMail(
attachments,
from: `"IBCornelsen" <info@online-energieausweis.org>`,
to: user.email,
subject: `Bestellbestätigung vom IBCornelsen (ID: ${ausweis.id})`,
subject: `Bestellbestätigung vom IBCornelsen (ID: ${id})`,
cc: {
address: rechnung.email || "",
name: rechnung.empfaenger || "",