EMAIL channel works correctly. The 5 EXPIRED from supervisor test were emails successfully sent but unacked (terminal channel). URGENT bypasses quiet hours (22h-7h UTC) and EMAIL sends fine. No code fix needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
1011 B
Bash
27 lines
1011 B
Bash
#!/bin/bash
|
|
set -e
|
|
cd /opt/erp/metallkart-erp
|
|
|
|
COOKIE_JAR=/tmp/mk-admin-cookies.txt
|
|
|
|
curl -s -X POST http://localhost:3001/api/v1/auth/login \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"email":"gruart@cifem-rus.ru","password":"MetallKart2026!"}' \
|
|
-c "$COOKIE_JAR" -o /dev/null
|
|
|
|
echo "=== Test EMAIL channel with URGENT priority (bypasses quiet hours) ==="
|
|
RESULT=$(curl -s -X POST http://localhost:3001/api/v1/notification-router/admin/test-dispatch \
|
|
-H "Content-Type: application/json" \
|
|
-b "$COOKIE_JAR" \
|
|
-d '{"targetUserId":"ebdd4d55-9aeb-45c3-a0b4-577dafbab887","channel":"EMAIL","title":"Test EMAIL URGENT 29/05","body":"Ce test utilise URGENT pour bypasser quiet hours","priority":"URGENT"}')
|
|
echo "Result: $RESULT"
|
|
|
|
sleep 3
|
|
echo ""
|
|
echo "=== Latest deliveries ==="
|
|
docker exec postgres-staging psql -U metallkart -d erp_staging -c "
|
|
SELECT id, channel::text, status::text, LEFT(\"failureReason\", 100) AS err, \"sentAt\"
|
|
FROM notification_deliveries
|
|
ORDER BY \"createdAt\" DESC LIMIT 3
|
|
"
|