Gospel page audio: narration script, ElevenLabs generator, player on /salvation, admin Gospel Page setting; v2.40.0
Publish Container / build (push) Successful in 17m6s
Publish Container / build (push) Successful in 17m6s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
330c354d54
commit
ad1c3e35b1
8 files changed
+293
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { Resend } from 'resend'
|
||||
import { escapeHtml } from '../helpers.js'
|
||||
import { escapeHtml, sanitizeUrl } from '../helpers.js'
|
||||
import { state } from '../state.js'
|
||||
import { getResendFromAddress, getResendInboxAddress, getResendReplyToAddress, getCanonicalBaseUrl, sendResendEmailWithRetry } from '../email.js'
|
||||
|
||||
// A visitor who finished the /salvation page can tell us they prayed to receive Christ.
|
||||
@@ -226,6 +227,13 @@ function buildSalvationConfirmationEmail({ name }) {
|
||||
}
|
||||
|
||||
export function register(app) {
|
||||
// The /salvation page is static HTML, so it asks the server for the narration URL set in Admin → Gospel Page.
|
||||
app.get('/api/salvation-audio', (_req, res) => {
|
||||
const url = sanitizeUrl(state.cachedSiteContent?.salvationAudioUrl) || ''
|
||||
res.set('Cache-Control', 'public, max-age=300')
|
||||
res.json({ url })
|
||||
})
|
||||
|
||||
app.post('/api/salvation-response', rateLimit, async (req, res) => {
|
||||
const { name, email, message, _honey } = req.body ?? {}
|
||||
if (_honey) { res.json({ ok: true }); return }
|
||||
|
||||
Reference in new issue
Block a user