Add notify-on-answer email and save-as-image for Q&A; v1.0.10

- Contact form: notifyOnAnswer checkbox (shown for Bible Questions only)
- Contact route: stores notifyOnAnswer flag on question record
- Email: buildQuestionAnsweredEmailTemplate for branded notification
- Questions route: sends notification email on approve when notifyOnAnswer + email + answer are set
- Q&A section: Canvas API "Save as image" button generates 1080x1080 PNG quote card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-07-22 12:51:38 -04:00
parent 43799b8c6d
commit d74b7523d3
6 changed files with 202 additions and 3 deletions
+2 -1
View File
@@ -102,7 +102,7 @@ function contactRateLimit(req, res, next) {
export function register(app) {
app.post('/api/contact', contactRateLimit, async (req, res) => {
try {
const { firstName, lastName, email, message, messageType, subscribe, _honey } = req.body ?? {}
const { firstName, lastName, email, message, messageType, subscribe, notifyOnAnswer, _honey } = req.body ?? {}
if (_honey) { res.json({ ok: true }); return }
@@ -164,6 +164,7 @@ export function register(app) {
answeredAt: null,
isApproved: false,
approvedAt: null,
notifyOnAnswer: notifyOnAnswer === true,
}
state.questions.unshift(question)
state.questions = state.questions.slice(0, MAX_QUESTIONS)