Compare commits
No commits in common. "5cf33146fe45ffa761963189c442780d02cbb392" and "57d4a095a405ed5fc8b7abb5aa2bee9881e6f959" have entirely different histories.
5cf33146fe
...
57d4a095a4
@ -39,7 +39,7 @@ curl -X POST http://localhost:3000/api/v1/email \
|
||||
"language": "en",
|
||||
"data": {
|
||||
"name": "John Doe",
|
||||
"barcode_content": "0123456789",
|
||||
"barcode_url": "https://barcodeapi.org/api/8/12345670?",
|
||||
"link": "https://portal.lauf-fuer-kaya.de/"
|
||||
}
|
||||
}'
|
||||
@ -95,7 +95,7 @@ The project uses:
|
||||
|
||||
### Welcome Email
|
||||
- Languages: 🇬🇧 English, 🇩🇪 German
|
||||
- Variables: `name`, `link`, `barcode_content`
|
||||
- Variables: `name`, `link`, `barcode_url`
|
||||
|
||||
### Password Reset
|
||||
- Languages: 🇬🇧 English, 🇩🇪 German
|
||||
|
@ -17,15 +17,10 @@ const sendEmailSchema = z.object({
|
||||
})
|
||||
|
||||
emailRouter.post('/', zValidator('json', sendEmailSchema), async (c) => {
|
||||
let { to, subject, templateName, language, data } = c.req.valid('json')
|
||||
const { to, subject, templateName, language, data } = c.req.valid('json')
|
||||
|
||||
try {
|
||||
const template = getEmailTemplate(templateName, language as Language)
|
||||
if (templateName === "welcome") {
|
||||
if (data.barcode_content === "0123456789") {
|
||||
data.barcode_url = "https://barcodeapi.org/api/128/0123456789?"
|
||||
}
|
||||
}
|
||||
await emailService.sendEmail({
|
||||
to,
|
||||
subject,
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user