An email template table, which contains the email subject and content written in the Gutenberg Editor. Template is general if course_instance_id is NULL, or specific to a course instance if course_instance_id is set. Supports adding exercise points/completions threshold templates for course instances.
| 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_id | uuid | true | public.courses | The course this email template belongs to. NULL for generic templates that are not course-specific. | ||
| 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. | |||
| email_template_type | email_template_type | false | Type of email template. Determines which placeholder replacements are available, and makes them available to automations. | |||
| 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. | |
| language | varchar(255) | true | Language code for the template, e.g. fi, en, sv. If null, language is not specified | |||
| 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. |
| Name | Definition |
|---|---|
| Credit registration | How a completed course module becomes a credit in the University of Helsinki study registry. Once the student has consented for the course and holds a student number proven to be theirs, one ledger row per completion is pushed to Sisu through Suotar and polled until the registry confirms the attainment. |
| Name | Type | Definition |
|---|---|---|
| email_templates_course_id_fkey | FOREIGN KEY | FOREIGN KEY (course_id) REFERENCES courses(id) |
| email_templates_created_at_not_null | n | NOT NULL created_at |
| email_templates_email_template_type_not_null | n | NOT NULL email_template_type |
| email_templates_id_not_null | n | NOT NULL id |
| email_templates_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| email_templates_subject_check | CHECK | CHECK ((TRIM(BOTH FROM subject) <> ’’::text)) |
| email_templates_updated_at_not_null | n | NOT NULL updated_at |
| Name | Definition |
|---|---|
| email_templates_pkey | CREATE UNIQUE INDEX email_templates_pkey ON public.email_templates USING btree (id) |
| unique_email_templates_type_language_general | CREATE UNIQUE INDEX unique_email_templates_type_language_general ON public.email_templates USING btree (email_template_type, language, deleted_at) NULLS NOT DISTINCT WHERE (course_id IS NULL) |
Generated by tbls