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:
@@ -36,6 +36,7 @@ export default function ContactForm() {
|
||||
}
|
||||
}, [source, studyName])
|
||||
const [subscribe, setSubscribe] = useState(true)
|
||||
const [notifyOnAnswer, setNotifyOnAnswer] = useState(true)
|
||||
const [honey, setHoney] = useState('')
|
||||
const [status, setStatus] = useState<'idle' | 'submitting' | 'error'>('idle')
|
||||
const [errorMsg, setErrorMsg] = useState('')
|
||||
@@ -71,7 +72,7 @@ export default function ContactForm() {
|
||||
const res = await fetch('/api/contact', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ ...fields, subscribe, _honey: honey }),
|
||||
body: JSON.stringify({ ...fields, subscribe, notifyOnAnswer: fields.messageType === 'question' ? notifyOnAnswer : false, _honey: honey }),
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
@@ -135,6 +136,16 @@ export default function ContactForm() {
|
||||
Message
|
||||
<textarea name="message" rows={6} required value={fields.message} onChange={handleChange} />
|
||||
</label>
|
||||
{fields.messageType === 'question' && (
|
||||
<label className="contact-consent">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={notifyOnAnswer}
|
||||
onChange={e => setNotifyOnAnswer(e.target.checked)}
|
||||
/>
|
||||
<span>Email me when this question is answered.</span>
|
||||
</label>
|
||||
)}
|
||||
<label className="contact-consent">
|
||||
<input
|
||||
type="checkbox"
|
||||
|
||||
Reference in New Issue
Block a user