-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: load email templates from files instead of database
- Loading branch information
1 parent
c9096d3
commit 9054bed
Showing
23 changed files
with
439 additions
and
242 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const billEmailTemplates = import.meta.glob<{ | ||
subject: string | ||
body: string | ||
}>('./**/*.ts') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Outstanding bill` | ||
const body = c`</p>Dear {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>In the attachment you can find the bill with an amount due of {{amountDue}}.</p> | ||
<p>You can also view and pay the bill <a href="\\{{invoiceUrl}}">here</a>. | ||
<p>If you have any questions about this bill, you can contact us.</p> | ||
<p>Kind regards,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Openstaande rekening` | ||
const body = c` | ||
<p>Beste {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>Bijgevoegd treft u uw rekening aan met een openstaand bedrag ter hoogte van {{amountDue}}.</p> | ||
<p>U kunt de rekening ook <a href="\\{{invoiceUrl}}">hier</a> bekijken en betalen. | ||
<p>Mocht u nog vragen hebben over deze rekening, dan kunt u contact met ons opnemen.</p> | ||
<p>Met vriendelijke groet,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const emailTemplates = import.meta.glob<{ | ||
subject: string | ||
body: string | ||
}>('./**/*.ts') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Exhortation invoice \\{{numberPrefix}}\\{{number}}` | ||
const body = c`</p>Dear {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>According to our administration the payment for invoice \\{{numberPrefix}}\\{{number}} is overdue.</p> | ||
<p>We would like to ask you to pay the open amount of {{totalIncludingTax}} within 5 days on account number {{companyDetails.iban}} in the name of {{companyDetails.name}} with mention of the invoice number.</p> | ||
<p>You can also view the invoice <a href="\\{{invoiceUrl}}">here</a>. | ||
<p>If the payment is not received we will be required to take further legal steps.</p> | ||
<p>Kind regards,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { c } from 'compress-tag' | ||
const subject = `Aanmaning factuur \\{{numberPrefix}}\\{{number}}` | ||
const body = c`<p>Beste {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>Uit onze administratie blijkt dat factuur \\{{numberPrefix}}\\{{number}} nog niet is voldaan.</p> | ||
<p>Wij willen u verzoeken het verschuldigde bedrag ter hoogte van {{totalIncludingTax}} alsnog binnen 5 dagen te betalen op rekeningnummer {{companyDetails.iban}} t.n.v. {{companyDetails.name}} onder vermelding van factuurnummer.</p> | ||
<p>U kunt de factuur ook <a href="\\{{invoiceUrl}}">hier</a> bekijken. | ||
<p>Indien de betaling uitblijft zijn we genoodzaakt verdere juridische stappen te nemen.</p> | ||
<p>Met vriendelijke groet,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const invoiceEmailTemplates = import.meta.glob<{ | ||
subject: string | ||
body: string | ||
}>('./**/*.ts') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Payment reminder invoice \\{{numberPrefix}}\\{{number}}` | ||
const body = c`</p>Dear {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>According to our administration the payment for invoice \\{{numberPrefix}}\\{{number}} is overdue.</p> | ||
<p>We would like to ask you to pay the open amount of {{totalIncludingTax}} within 7 days on account number {{companyDetails.iban}} in the name of {{companyDetails.name}} with mention of the invoice number.</p> | ||
<p>You can also view the invoice <a href="\\{{invoiceUrl}}">here</a>. | ||
<p>If you have any questions about this invoice, you can contact us.</p> | ||
<p>Kind regards,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Betalingsherinnering factuur \\{{numberPrefix}}\\{{number}}` | ||
const body = c` | ||
<p>Beste {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>Uit onze administratie blijkt dat factuur \\{{numberPrefix}}\\{{number}} nog niet is voldaan.</p> | ||
<p>Wij willen u verzoeken het verschuldigde bedrag ter hoogte van {{totalIncludingTax}} alsnog binnen 7 dagen te betalen op rekeningnummer {{companyDetails.iban}} t.n.v. {{companyDetails.name}} onder vermelding van factuurnummer.</p> | ||
<p>U kunt de factuur ook <a href="\\{{invoiceUrl}}">hier</a> bekijken. | ||
<p>Mocht u nog vragen hebben over deze factuur, dan kunt u contact met ons opnemen.</p> | ||
<p>Met vriendelijke groet,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Invoice \\{{numberPrefix}}\\{{number}}` | ||
const body = c` | ||
</p>Dear {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>In the attachment you can find invoice \\{{numberPrefix}}\\{{number}} for our services.</p> | ||
{{#unless paid}} | ||
<p>We would like to ask you to pay the amount of {{totalIncludingTax}} within {{paymentTermDays}} days (before \\{{dueDate}}) on account number {{companyDetails.iban}} in the name of {{companyDetails.name}} with mention of the invoice number.</p> | ||
{{/unless}} | ||
<p>You can also view the invoice <a href="\\{{invoiceUrl}}">here</a>. | ||
<p>If you have any questions about this invoice, you can contact us.</p> | ||
<p>Kind regards,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { c } from 'compress-tag' | ||
|
||
const subject = `Factuur \\{{numberPrefix}}\\{{number}}` | ||
const body = c`<p>Beste {{#if clientDetails.contactPersonName}}{{clientDetails.contactPersonName}}{{else}}{{clientDetails.companyName}}{{/if}},</p> | ||
<p>Bijgevoegd treft u factuur \\{{numberPrefix}}\\{{number}} aan voor de geleverde diensten.</p> | ||
{{#unless paid}} | ||
<p>Gelieve het verschuldigde bedrag ter hoogte van {{totalIncludingTax}} te betalen binnen {{paymentTermDays}} dagen (voor \\{{dueDate}}) op rekeningnummer {{companyDetails.iban}} t.n.v. {{companyDetails.name}} onder vermelding van factuurnummer.</p> | ||
{{/unless}} | ||
<p>U kunt de factuur ook <a href="\\{{invoiceUrl}}">hier</a> bekijken. | ||
<p>Mocht u nog vragen hebben over deze factuur, dan kunt u contact met ons opnemen.</p> | ||
<p>Met vriendelijke groet,</p> | ||
<p>{{companyDetails.name}}</p>` | ||
|
||
export { subject, body } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const receiptEmailTemplates = import.meta.glob<{ | ||
subject: string | ||
body: string | ||
}>('./**/*.ts') |
Oops, something went wrong.