6 Commits

Author SHA1 Message Date
philipp 96e3be543b chore: 1.1.0
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:37:43 +01:00
philipp c8781e3a3d refactor: move barcode generation to document server 2024-12-12 18:37:25 +01:00
philipp 22ab25045c chore: 1.0.2
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
2024-12-11 22:59:17 +01:00
philipp 2230259e4a Merge branch 'dev' of https://git.odit.services/lfk/mailer into dev
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-11 22:55:42 +01:00
philipp 57f3a910f6 tmp-fix(templates): use barcode generation api 2024-12-11 22:55:30 +01:00
philipp 9076a9488e fix(templates): use logo from frontend 2024-12-11 22:55:15 +01:00
8 changed files with 7 additions and 20 deletions
+1
View File
@@ -6,6 +6,7 @@ EMAIL_FROM="noreply@lauf-fuer-kaya.de"
EMAIL_REPLYTO="info@lauf-fuer-kaya.de"
REDIS_URL=redis://localhost:6379
FRONTEND_URL="https://run.lauf-fuer-kaya.de"
DOCUMENT_SERVER_URL="https://documents.run.lauf-fuer-kaya.de/"
AUTHKEY=""
EVENT_DATE="23.05.2025"
EVENT_NAME="Lauf für Kaya! 2025"
Regular → Executable
BIN
View File
Binary file not shown.
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@odit/lfk-mailer",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"type": "module",
"scripts": {
@@ -13,7 +13,6 @@
"@hono/zod-openapi": "0.18.3",
"@hono/zod-validator": "0.4.1",
"bullmq": "5.34.0",
"bwip-js": "4.5.1",
"handlebars": "4.7.8",
"hono": "4.6.13",
"ioredis": "5.4.1",
+1 -14
View File
@@ -5,7 +5,6 @@ import { z } from 'zod'
import { EmailService } from '../services/email'
import { getEmailTemplate } from '../templates'
import { Language } from '../types'
import { toBuffer } from 'bwip-js/node'
const emailRouter = new Hono()
const emailService = new EmailService()
@@ -18,19 +17,7 @@ const sendEmailSchema = z.object({
})
async function generateBarcodeDataURL(data) {
const buffer = await toBuffer({
bcid: 'code128',
text: data,
scale: 3,
height: 10,
includetext: true,
textxalign: 'center',
});
const base64Data = buffer.toString('base64');
const dataURL = `data:image/png;base64,${base64Data}`;
return dataURL;
return `${process.env.DOCUMENT_SERVER_URL}/v1/barcodes/code128/${data}`
}
emailRouter.post('/', bearerAuth({ token: process.env.AUTHKEY }), zValidator('json', sendEmailSchema), async (c) => {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long