You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the email template relations are directly specified in the tables, so that, for example, course has three different fields for templates of varying types.
As the template types and uses for the templating system seems to grow and the current implementation is not very flexible, it would be beneficial to refactor this.
An idea would be to have a many-to-many relation:
the join table could have fields for whatever might be using the template, so in addition to the email_template_id, one or more of course_id, completion_id, course_stats_subscription_id, organization_id and so on
the templates itself would have the types as they currently do, perhaps converted to enums * the triggers should be refactored accordingly, so as we currently check if a course has a completion_email set, we would see if there's a template with the type of completion associated with the course -- the same would apply to other types
This shouldn't be too much of a job (famous last words.)
The text was updated successfully, but these errors were encountered:
mipyykko
changed the title
Convert EmailTemplate relations
Refactor EmailTemplate relations
Aug 24, 2022
Currently the email template relations are directly specified in the tables, so that, for example,
course
has three different fields for templates of varying types.As the template types and uses for the templating system seems to grow and the current implementation is not very flexible, it would be beneficial to refactor this.
An idea would be to have a many-to-many relation:
email_template_id
, one or more ofcourse_id
,completion_id
,course_stats_subscription_id
,organization_id
and so oncompletion_email
set, we would see if there's a template with the type ofcompletion
associated with the course -- the same would apply to other typesThis shouldn't be too much of a job (famous last words.)
The text was updated successfully, but these errors were encountered: