mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-28 19:59:18 -04:00
Add basic flow for adding email _or_ sms templates
Templates now have: - a type (email or sms) - a subject (if they are email templates) We don’t want two completely separate view files for email and SMS, because they would have an enormous amount of repetition. So this commit adds - different templates for SMS and email templates - different form objects for SMS and email templates …and wires them up.
This commit is contained in:
@@ -188,7 +188,7 @@ class ConfirmPasswordForm(Form):
|
||||
raise ValidationError('Invalid password')
|
||||
|
||||
|
||||
class TemplateForm(Form):
|
||||
class SMSTemplateForm(Form):
|
||||
name = StringField(
|
||||
u'Template name',
|
||||
validators=[DataRequired(message="Template name cannot be empty")])
|
||||
@@ -198,6 +198,13 @@ class TemplateForm(Form):
|
||||
validators=[DataRequired(message="Template content cannot be empty")])
|
||||
|
||||
|
||||
class EmailTemplateForm(SMSTemplateForm):
|
||||
|
||||
subject = StringField(
|
||||
u'Subject',
|
||||
validators=[DataRequired(message="Subject cannot be empty")])
|
||||
|
||||
|
||||
class ForgotPasswordForm(Form):
|
||||
email_address = email_address()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user