email formatting

This commit is contained in:
2025-10-07 09:10:37 -04:00
parent 8afcac954c
commit 2f505ad7e2
3 changed files with 11 additions and 10 deletions

View File

@@ -45,13 +45,16 @@ export default defineEventHandler(async (event) => {
const noteRecord = getSermonNote(user.id!, sermonId)
const userNotes = noteRecord?.notes || ''
// Format bible references
// Format bible references for HTML email
let bibleReferencesText = ''
try {
const refs = JSON.parse(sermon.bible_references)
bibleReferencesText = refs.map((ref: any) =>
`${ref.reference} (${ref.version})\n${ref.text}`
).join('\n\n')
`<div style="margin-bottom: 15px;">
<div style="font-weight: bold; margin-bottom: 5px;">${ref.reference} (${ref.version})</div>
<div>${ref.text}</div>
</div>`
).join('')
} catch {
bibleReferencesText = sermon.bible_references
}