update invoice
This commit is contained in:
parent
6df1cfef6b
commit
e16e62935d
@ -7,7 +7,6 @@ import {authOptions} from "@/pages/api/auth/[...nextauth]";
|
||||
import prisma from "@/lib/prisma"
|
||||
|
||||
// FESTE KONSTANTEN
|
||||
const FIXED_PAYPAL_EMAIL = "deine_feste_paypal_adresse@example.com"; // <-- HIER DEINE PAYPAL E-MAIL EINTRAGEN
|
||||
const FIXED_CASH_PAYMENT_CONTACTS = "Thomas, Elias oder Paul"; // <-- HIER DEINE KONTAKTE EINTRAGEN
|
||||
|
||||
interface SendBulkInvoicesRequestBody {
|
||||
@ -67,7 +66,7 @@ function createInvoiceHtml(
|
||||
<p>Bitte begleiche diesen Betrag bis zum <strong>${formattedDeadline}</strong>.</p>
|
||||
<h2>Zahlungsmöglichkeiten:</h2>
|
||||
<ul>
|
||||
<li><strong>PayPal:</strong> <a href="${paypalMeLink}" target="_blank">${paypalMeLink}</a> (oder sende an ${FIXED_PAYPAL_EMAIL})</li>
|
||||
<li><strong>PayPal:</strong> <a href="${paypalMeLink}" target="_blank">${paypalMeLink}</a></li>
|
||||
<li><strong>Bar an:</strong> ${FIXED_CASH_PAYMENT_CONTACTS}</li>
|
||||
</ul>
|
||||
<p>Vielen Dank!</p>
|
||||
@ -114,7 +113,7 @@ async function sendInvoiceEmail(
|
||||
console.log("----------------------------------------------------");
|
||||
console.log(`SIMULIERTER E-Mail-Versand an: ${userEmail}`);
|
||||
console.log(`Betreff: Deine Strichlisten-Rechnung - Saldo: ${formattedBalanceSim}€`);
|
||||
console.log(`Inhalt: Saldo ${formattedBalanceSim}€, Frist ${formattedDeadlineSim}, PayPal Link ${paypalMeLinkSim} (oder an ${FIXED_PAYPAL_EMAIL}), Bar bei ${FIXED_CASH_PAYMENT_CONTACTS}`);
|
||||
console.log(`Inhalt: Saldo ${formattedBalanceSim}€, Frist ${formattedDeadlineSim}, PayPal Link ${paypalMeLinkSim}, Bar bei ${FIXED_CASH_PAYMENT_CONTACTS}`);
|
||||
console.log("----------------------------------------------------");
|
||||
return { success: true };
|
||||
}
|
||||
@ -126,6 +125,14 @@ async function sendInvoiceEmail(
|
||||
to: userEmail,
|
||||
subject: `Deine Strichlisten-Rechnung - Saldo: ${balance.toFixed(2)}€`,
|
||||
html: htmlContent,
|
||||
text: `Hallo ${userName || ''},\n\n` +
|
||||
`dein aktueller Saldo auf der Strichliste beträgt: ${balance.toFixed(2)} €.\n` +
|
||||
`Bitte begleiche diesen Betrag bis zum ${new Date(deadline).toLocaleDateString('de-DE', { year: 'numeric', month: 'long', day: 'numeric' })}.\n\n` +
|
||||
`Zahlungsmöglichkeiten:\n` +
|
||||
`- PayPal: http://paypal.me/thomasqst/${balance.toFixed(2)}\n` +
|
||||
`- Bar an: ${FIXED_CASH_PAYMENT_CONTACTS}\n\n` +
|
||||
`Vielen Dank!\n` +
|
||||
`Dein Strichlisten-Team`
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user