Files
linumiq-invoice/app/services/invoice/emailTemplates.ts
T
Gerhard Scheikl 573dfbfd50 feat(email): default template with inline logo + shop contact vars
Mirrors the layout from data/mail_template.png:
- Company name + greeting headline
- Body referencing the invoice number
- Inline logo (cid:invoice-logo) attached automatically
- Footer with mailto + website links

New template vars: {{shopEmail}}, {{shopWebsite}}.
Settings UI prefills empty fields with the defaults so users see and
can tweak them without losing the fallback.
2026-05-08 23:12:23 +02:00

53 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Default invoice email templates per language. Used when the user hasn't
* customised them in settings. Variables ({{invoiceNumber}}, etc.) are
* substituted by `renderTemplate` at send time.
*
* The shop logo is rendered as an inline attachment with content-id
* `invoice-logo`; the email sender attaches the logo bytes automatically
* when the template (or any custom template) references that cid.
*/
const DE_HTML = `\
<h2 style="color:#3070c0;margin:0 0 8px;font-family:Arial,Helvetica,sans-serif;">{{companyName}}</h2>
<h3 style="color:#3070c0;margin:0 0 16px;font-family:Arial,Helvetica,sans-serif;">Danke für deinen Einkauf!</h3>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5;">
Die Rechnung befindet sich im Anhang.
</p>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5;">
Bei Überweisung bitte die Rechnungs-Nummer als Referenz verwenden:
<strong>{{invoiceNumber}}</strong><br>
Besten Dank!
</p>
<p style="margin-top:24px;">
<img src="cid:invoice-logo" alt="{{companyName}}" style="max-height:48px;">
</p>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:1.6;color:#3070c0;">
✉ <a href="mailto:{{shopEmail}}" style="color:#3070c0;">Kontakt</a><br>
🌐 <a href="{{shopWebsite}}" style="color:#3070c0;">{{shopWebsite}}</a>
</p>`;
const EN_HTML = `\
<h2 style="color:#3070c0;margin:0 0 8px;font-family:Arial,Helvetica,sans-serif;">{{companyName}}</h2>
<h3 style="color:#3070c0;margin:0 0 16px;font-family:Arial,Helvetica,sans-serif;">Thank you for your purchase!</h3>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5;">
Please find the invoice attached.
</p>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5;">
When paying by bank transfer, please use the invoice number as the reference:
<strong>{{invoiceNumber}}</strong><br>
Thanks a lot!
</p>
<p style="margin-top:24px;">
<img src="cid:invoice-logo" alt="{{companyName}}" style="max-height:48px;">
</p>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:1.6;color:#3070c0;">
✉ <a href="mailto:{{shopEmail}}" style="color:#3070c0;">Contact</a><br>
🌐 <a href="{{shopWebsite}}" style="color:#3070c0;">{{shopWebsite}}</a>
</p>`;
export const DEFAULT_EMAIL_SUBJECT_DE = "Rechnung {{invoiceNumber}} {{companyName}}";
export const DEFAULT_EMAIL_SUBJECT_EN = "Invoice {{invoiceNumber}} {{companyName}}";
export const DEFAULT_EMAIL_BODY_DE = DE_HTML;
export const DEFAULT_EMAIL_BODY_EN = EN_HTML;