Add customizable email templates and remove alert recipients
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 7s
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 7s
Replaced the fixed `alert_recipients` list with customizable subject and body templates for alerts and warnings. This allows for more flexible and dynamic email notifications using placeholder variables. Updated relevant backend and frontend components to support this feature.
This commit is contained in:
31
backend/alembic/versions/0007_email_templates.py
Normal file
31
backend/alembic/versions/0007_email_templates.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""email templates and drop recipients list
|
||||
|
||||
Revision ID: 0007_email_templates
|
||||
Revises: 0006_email_from_name
|
||||
Create Date: 2026-02-12
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "0007_email_templates"
|
||||
down_revision = "0006_email_from_name"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("email_notification_settings", sa.Column("warning_subject_template", sa.Text(), nullable=True))
|
||||
op.add_column("email_notification_settings", sa.Column("alert_subject_template", sa.Text(), nullable=True))
|
||||
op.add_column("email_notification_settings", sa.Column("warning_body_template", sa.Text(), nullable=True))
|
||||
op.add_column("email_notification_settings", sa.Column("alert_body_template", sa.Text(), nullable=True))
|
||||
op.drop_column("email_notification_settings", "alert_recipients")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.add_column("email_notification_settings", sa.Column("alert_recipients", sa.JSON(), nullable=False, server_default="[]"))
|
||||
op.drop_column("email_notification_settings", "alert_body_template")
|
||||
op.drop_column("email_notification_settings", "warning_body_template")
|
||||
op.drop_column("email_notification_settings", "alert_subject_template")
|
||||
op.drop_column("email_notification_settings", "warning_subject_template")
|
||||
Reference in New Issue
Block a user