Bedarfsausweis gewerbe
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
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";
|
||||
import { shortenUID } from "#server/lib/hash.js";
|
||||
|
||||
export async function sendInvoiceMail(
|
||||
ausweis: VerbrauchsausweisWohnen,
|
||||
@@ -35,6 +35,9 @@ export async function sendInvoiceMail(
|
||||
|
||||
const attachments: Mail.Attachment[] = [];
|
||||
|
||||
const id = shortenUID(ausweis.uid)
|
||||
|
||||
|
||||
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen) {
|
||||
const ansichtsausweis = await getAnsichtsausweis(
|
||||
ausweis,
|
||||
@@ -48,7 +51,7 @@ export async function sendInvoiceMail(
|
||||
if (ansichtsausweis) {
|
||||
attachments.push(
|
||||
{
|
||||
filename: `ID_${ausweis.id}_Ansichtsausweis.pdf`,
|
||||
filename: `ID_${id}_Ansichtsausweis.pdf`,
|
||||
encoding: "binary",
|
||||
content: Buffer.from(ansichtsausweis),
|
||||
contentType: "application/pdf",
|
||||
@@ -62,7 +65,7 @@ export async function sendInvoiceMail(
|
||||
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 || "",
|
||||
|
||||
Reference in New Issue
Block a user