feat: HTML email template, structured text storage and Freescout design

compose.yaml:
- Add hostname n8n.eks-intec.de to fix SMTP HELO rejection
- Add NODE_TLS_REJECT_UNAUTHORIZED=0 for internal CA trust

workflow-a-http.json:
- Replace Set node with Code node for reliable data extraction
- Strip HTML from thread bodies before AI analysis
- Preserve newlines as ¶ (pilcrow) in DB storage instead of flattening

workflow-b-http.json:
- Add Prepare Email Body node: restores ¶→\n, strips markdown,
  converts numbered lists to <ol><li>, generates HTML email template
- Switch emailSend from plain text to HTML+text (multipart)
- Fix Log Reply to Freescout: use MAX(created_at)+1s to ensure
  n8n reply appears as newest thread regardless of email header timestamps
- Fix emailSend typeVersion 1 with text field for reliable expression support
- Correct Freescout thread INSERT: type=2, cc/bcc='[]', customer_id via subquery

freescout-templates/:
- Modern reply_fancy.blade.php: blue header bar with mailbox name and
  ticket number badge, quoted thread styling with left border accent, footer
- Modern auto_reply.blade.php: matching design for auto-reply emails
- Deploy to server: scp to /tmp, apply with sudo cp + artisan view:clear

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Code
2026-03-17 17:27:49 +01:00
parent 580dfc25e3
commit 6b60059c00
5 changed files with 505 additions and 340 deletions

View File

@@ -24,6 +24,7 @@ services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
hostname: n8n.eks-intec.de
ports:
- "127.0.0.1:5678:5678"
labels:
@@ -51,6 +52,7 @@ services:
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- TZ=${GENERIC_TIMEZONE}
- NODE_TLS_REJECT_UNAUTHORIZED=0
volumes:
- n8n_data:/home/node/.n8n
- ./local-files:/files