Add Q&A answered email template to admin Email Templates panel; v1.0.11

- content.ts: add qaAnsweredEmailSubject/Body/CtaLabel/Signoff fields + defaults
- email.js: buildQuestionAnsweredEmailTemplate reads from cachedSiteContent
- AdminPage.tsx: add EmailTemplateCard entry for Q&A answered notification

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-07-22 12:55:07 -04:00
parent d74b7523d3
commit 6444d6e0e3
4 changed files with 33 additions and 5 deletions
+10
View File
@@ -482,6 +482,12 @@ function EmailTemplatesPanel({
fieldKeys={['twoFaOtpEmailSubject','twoFaOtpEmailBody','twoFaOtpEmailExpiry']}
openKey="2fa-otp" />
<EmailTemplateCard type="transactional" icon="💬" title="Q&amp;A — Question Answered Notification"
trigger={'An admin approves a Q&A question submitted with "Email me when answered" checked'}
autoVars={'Submitter\'s first name, their original question text, the answer (truncated to 600 chars), a direct link to the answer'}
fieldKeys={['qaAnsweredEmailSubject','qaAnsweredEmailBody','qaAnsweredEmailCtaLabel','qaAnsweredEmailSignoff']}
openKey="qa-answered" />
{renderSaveStatus()}
</section>
)
@@ -990,6 +996,10 @@ const FIELDS: Array<{ key: StringField; label: string; multiline?: boolean; sect
{ key: 'twoFaOtpEmailSubject', label: 'Subject Line', section: 'email-templates' },
{ key: 'twoFaOtpEmailBody', label: 'Body Text (shown above the code)', multiline: true, section: 'email-templates' },
{ key: 'twoFaOtpEmailExpiry', label: 'Expiry / Security Note (shown below the code)', multiline: true, section: 'email-templates' },
{ key: 'qaAnsweredEmailSubject', label: 'Subject Line', section: 'email-templates' },
{ key: 'qaAnsweredEmailBody', label: 'Body Text (paragraph shown below the greeting)', multiline: true, section: 'email-templates' },
{ key: 'qaAnsweredEmailCtaLabel', label: 'Button Label', section: 'email-templates' },
{ key: 'qaAnsweredEmailSignoff', label: 'Signoff', multiline: true, section: 'email-templates' },
]
function normalizeStudies(siteContent: SiteContent): StudyProgram[] {