feat: e-mail templates (#1158)

* View definition added

* Get templates and texts from the database.

* Fill in texts in templates

* Fill in texts in templates

* Client API added

* Weekly backup

* Weekly backup

* Daily backup

* Weekly backup

* Tests added

* Corrections from merge branch

* Fixes from pull request review
This commit is contained in:
Michael Waeger
2021-01-18 14:17:22 +01:00
committed by GitHub
parent e7540e5e05
commit f2a32871a7
88 changed files with 5325 additions and 155 deletions

View File

@@ -0,0 +1,78 @@
CREATE TABLE adminapi.mail_templates (
aggregate_id TEXT,
creation_date TIMESTAMPTZ,
change_date TIMESTAMPTZ,
mail_template_state SMALLINT,
sequence BIGINT,
template BYTES,
PRIMARY KEY (aggregate_id)
);
CREATE TABLE management.mail_templates (
aggregate_id TEXT,
creation_date TIMESTAMPTZ,
change_date TIMESTAMPTZ,
mail_template_state SMALLINT,
sequence BIGINT,
template BYTES,
PRIMARY KEY (aggregate_id)
);
GRANT SELECT ON TABLE adminapi.mail_templates TO notification;
GRANT SELECT ON TABLE management.mail_templates TO notification;
CREATE TABLE adminapi.mail_texts (
aggregate_id TEXT,
creation_date TIMESTAMPTZ,
change_date TIMESTAMPTZ,
mail_text_state SMALLINT,
sequence BIGINT,
mail_text_type TEXT,
language TEXT,
title TEXT,
pre_header TEXT,
subject TEXT,
greeting TEXT,
text TEXT,
button_text TEXT,
PRIMARY KEY (aggregate_id, mail_text_type, language)
);
CREATE TABLE management.mail_texts (
aggregate_id TEXT,
creation_date TIMESTAMPTZ,
change_date TIMESTAMPTZ,
mail_text_state SMALLINT,
sequence BIGINT,
mail_text_type TEXT,
language TEXT,
title TEXT,
pre_header TEXT,
subject TEXT,
greeting TEXT,
text TEXT,
button_text TEXT,
PRIMARY KEY (aggregate_id, mail_text_type, language)
);
GRANT SELECT ON TABLE adminapi.mail_texts TO notification;
GRANT SELECT ON TABLE management.mail_texts TO notification;
ALTER TABLE management.project_roles ADD COLUMN change_date TIMESTAMPTZ;
ALTER TABLE auth.project_roles ADD COLUMN change_date TIMESTAMPTZ;