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

@@ -77,9 +77,11 @@ export default defineEventHandler(async (event) => {
// Create formatted text content
const textContent = `
================================================================================
SERMON NOTES
New Life Christian Church
================================================================================
SERMON NOTES
Title: ${sermon.title}
Date: ${sermonDate}
@@ -106,10 +108,6 @@ MY NOTES
================================================================================
${userNotes}
================================================================================
New Life Christian Church
================================================================================
`.trim()
// Set headers for file download

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
}

View File

@@ -93,7 +93,7 @@ ${userNotes || 'No notes taken'}
<div style="background-color: #E3F2FD; padding: 15px; border-radius: 5px; margin: 20px 0;">
<h3 style="color: #1976D2; margin-top: 0;">Bible References</h3>
<div style="color: #333; white-space: pre-wrap;">${bibleReferences}</div>
<div style="color: #333;">${bibleReferences}</div>
</div>
<div style="background-color: #E8F5E9; padding: 15px; border-radius: 5px; margin: 20px 0;">
@@ -112,7 +112,7 @@ ${userNotes || 'No notes taken'}
</div>
<div style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; color: #666; font-size: 12px;">
<p>This email was sent from New Life Christian Church Sermon Notes</p>
<p>This email was sent from New Life Christian Church.</p>
</div>
</div>
`,