Index

public.email_templates

Description

An email template table, which contains the email subject and content written in the Gutenberg Editor. Supports adding exercise points/completions threshold templates for course instances.

Columns

Name Type Default Nullable Children Parents Comment
content jsonb true Content of the email in an abstract form. Uses the same structure for the data as pages.content but the allowed blocks here is limited. The html and plain text versions of the email are generated from this.
course_instance_id uuid false public.course_instances Which course instance this email is from. Used for bookkeeping, deriving dynamic parts of the message and also used for the automatic email sending thresholds.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
exercise_completions_threshold integer true If sending the email is automated, send the email when the student has completed at least n exercise from a course instance.
id uuid uuid_generate_v4() false public.email_deliveries A unique, stable identifier for the record.
name varchar(255) false Human readable name of the email template that is used in listings in the teacher dashboard.
points_threshold integer true If the sending of the email is automated, send the email once the student has gotten at least n points from a course instance.
subject varchar(255) true Subject of the email. This is what the receiver will see when they get the message.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.

Constraints

Name Type Definition
email_templates_course_instance_id_fkey FOREIGN KEY FOREIGN KEY (course_instance_id) REFERENCES course_instances(id)
email_templates_pkey PRIMARY KEY PRIMARY KEY (id)
email_templates_subject_check CHECK CHECK ((TRIM(BOTH FROM subject) <> ’’::text))

Indexes

Name Definition
email_templates_pkey CREATE UNIQUE INDEX email_templates_pkey ON public.email_templates USING btree (id)

Relations

er

Generated by tbls