Skip to content

Commit 87493ef

Browse files
committed
convert emails to html
1 parent 217b8f1 commit 87493ef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/send-email.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,25 @@ jobs:
9595
9696
echo " Title: $TITLE"
9797
98+
# Convert markdown to HTML using pandoc
99+
POST_HTML=$(echo "$POST_CONTENT" | pandoc -f markdown -t html)
100+
98101
# Escape content for JSON
99-
POST_CONTENT_ESCAPED=$(echo "$POST_CONTENT" | jq -Rs .)
102+
POST_HTML_ESCAPED=$(echo "$POST_HTML" | jq -Rs .)
100103
101104
# Create JSON payload
102105
JSON_PAYLOAD=$(jq -n \
103106
--arg segment_id "$RESEND_SEGMENT_ID" \
104107
--arg from "dropalltables <blog@system.viruus.zip>" \
105108
--arg name "$TITLE" \
106109
--arg subject "$TITLE" \
107-
--argjson text "$POST_CONTENT_ESCAPED" \
110+
--argjson html "$POST_HTML_ESCAPED" \
108111
'{
109112
segment_id: $segment_id,
110113
from: $from,
111114
name: $name,
112115
subject: $subject,
113-
text: $text
116+
html: $html
114117
}')
115118
116119
# Create broadcast via Resend API

0 commit comments

Comments
 (0)