Skip to content

Commit

Permalink
Reworked new user e-mail
Browse files Browse the repository at this point in the history
  • Loading branch information
megastary committed Oct 28, 2023
1 parent ced18fb commit 2f8fb81
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
11 changes: 8 additions & 3 deletions functions/azure-passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ passport.use(
}
}
)
const subject = `Lednice IT je pyšná, že ji navštívila osoba jménem ${newUser.displayName}`
const body = `<h1>Lednice IT Vás vítá!</h1><p>Snad se Vám zde bude líbit.</p><p>Vaše ID pro objednávání skrze kiosek: ${newUser.keypadId}</p><h2>Jak to funguje</h2><p>Do Lednice IT dodává produkty více dodavatelů. Zákazník si přes e-shop či přes kiosek zakoupí vybraný produkt. Až se dodavateli nashromáždí dostatek prodaného zboží, vytvoří hromadnou fakturaci. Každý zákazník, který si u daného dodavatele něco zakoupil obdrží e-mail s QR kódem, který uhradí. Platbu obě strany potvrdí v rozhraní e-shopu.</p><p>Pokud se budete chtít stát dodavatelem, kontaktujte správce Lednice IT.</p>`
sendMail(newUser.email, subject, body)
const subject = 'Potvrzení registrace nového zákazníka'
const mailPreview = `Zákazník ${newUser.displayName} registrován s ID ${newUser.keypadId}.`

sendMail(newUser.email, 'newUserWelcome', {
subject,
mailPreview,
keypadId: newUser.keypadId
})
})
.catch((err) => {
logger.error(
Expand Down
2 changes: 1 addition & 1 deletion tasks/daily-unpaid-invoices-notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var dailyReport = scheduleJob(rule, function () {
const subject = `${noticeCount}. výzva k úhradě faktury po splatnosti`
const mailPreview = `Částka k úhradě ${docs[i].totalCost} Kč.`

sendMail(docs[i].buyer[0].email, 'invoiceNotice', {
sendMail(docs[i].buyer[0].email, 'unpaidInvoiceNotice', {
subject,
mailPreview,
invoiceId: docs[i]._id,
Expand Down
78 changes: 78 additions & 0 deletions views/email/newUserWelcome.handlebars
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{> title title="Potvrzení registrace" }}
{{! Single column template }}
<table width='640' cellpadding='0' cellspacing='0' border='0' class='wrapper' bgcolor='#f6f6f6'>

{{! Spacer }}
<tr>
<td height='10' style='font-size:10px; line-height:10px;'>&nbsp;</td>
</tr>

<tr>
<td align='center' valign='top'>

<table width='600' cellpadding='0' cellspacing='0' border='0' class='container'>

{{! 1st row - text }}
<tr>
{{! Middle column }}
<td align='center' valign='top'>
{{! Single column template }}
<table width='640' cellpadding='0' cellspacing='0' border='0' class='wrapper' bgcolor='#f6f6f6'>

{{! Spacer }}
<tr>
<td height='10' style='font-size:10px; line-height:10px;'>&nbsp;</td>
</tr>

<tr>
<td align='center' valign='top'>

<table width='600' cellpadding='0' cellspacing='0' border='0' class='container'>
<tr>

{{! Middle column }}
<td align='left' valign='top'>
<p>Vážený zákazníku,</p>
<p>vítejte v našem e-shopu Lednice IT! Jsme velmi potěšeni, že jste se rozhodli pro registraci.</p>
<p>Před tím, než se pustíte do nakupování, přečtěte si prosím naši dokumentaci, která Vám veškeré procesy vysvětlí.
Pokud i poté budete mít jakékoliv dotazy nebo budete potřebovat pomoc, neváhejte nás kontaktovat.</p>
<p>Níže je Vaše ID, které můžete použít pro nákup na samoobslužném kiosku přímo u lednice.</p>
<h2 style="text-align: center;">{{keypadId}}</h2>
<p>Děkujeme vám ještě jednou za registraci a těšíme se na Vaše nákupy!</p>
</td>

</tr>
</table>

</td>
</tr>

{{! Spacer }}
<tr>
<td height='10' style='font-size:10px; line-height:10px;'>&nbsp;</td>
</tr>

</table>
</td>

</tr>

{{! 2nd row - button }}
<tr>
{{! Middle column }}
<td align='center' valign='top'>
{{!-- Button table partial --}}
{{> centerButton label="Dokumentace" baseUrl=baseUrl path="/documentation" }}
</td>
</tr>
</table>

</td>
</tr>

{{! Spacer }}
<tr>
<td height='10' style='font-size:10px; line-height:10px;'>&nbsp;</td>
</tr>

</table>
File renamed without changes.

0 comments on commit 2f8fb81

Please sign in to comment.