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:
@@ -482,6 +482,12 @@ function EmailTemplatesPanel({
|
||||
fieldKeys={['twoFaOtpEmailSubject','twoFaOtpEmailBody','twoFaOtpEmailExpiry']}
|
||||
openKey="2fa-otp" />
|
||||
|
||||
<EmailTemplateCard type="transactional" icon="💬" title="Q&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[] {
|
||||
|
||||
@@ -239,6 +239,11 @@ export interface SiteContent {
|
||||
twoFaOtpEmailSubject: string
|
||||
twoFaOtpEmailBody: string
|
||||
twoFaOtpEmailExpiry: string
|
||||
// ── Q&A Answered Notification ──
|
||||
qaAnsweredEmailSubject: string
|
||||
qaAnsweredEmailBody: string
|
||||
qaAnsweredEmailCtaLabel: string
|
||||
qaAnsweredEmailSignoff: string
|
||||
// ── Header ──
|
||||
headerFollowLabel: string
|
||||
// ── Cookie banner ──
|
||||
@@ -430,6 +435,10 @@ export const DEFAULTS: SiteContent = {
|
||||
twoFaOtpEmailSubject: 'Your sign-in code — Verse by Verse with Nate',
|
||||
twoFaOtpEmailBody: 'Your two-factor sign-in code is below. Enter it to complete sign-in.',
|
||||
twoFaOtpEmailExpiry: 'This code expires in 10 minutes. If you did not request this, you can ignore this message.',
|
||||
qaAnsweredEmailSubject: 'Your question has been answered — Verse by Verse with Nate',
|
||||
qaAnsweredEmailBody: 'Nate has answered your question on Verse by Verse with Nate.',
|
||||
qaAnsweredEmailCtaLabel: 'Read Full Answer →',
|
||||
qaAnsweredEmailSignoff: 'Grace and peace,\nNate',
|
||||
headerFollowLabel: 'Follow on Spotify',
|
||||
cookieBannerText: 'We use optional analytics cookies to better understand how people find and engage with this content. By accepting, you allow us to measure how you interact with the site — no personal data is sold or shared.',
|
||||
customLinks: [],
|
||||
|
||||
Reference in New Issue
Block a user