Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor EmailTemplate relations #1010

Open
mipyykko opened this issue Aug 24, 2022 · 0 comments
Open

Refactor EmailTemplate relations #1010

mipyykko opened this issue Aug 24, 2022 · 0 comments

Comments

@mipyykko
Copy link
Collaborator

mipyykko commented 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:

  • 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.)

@mipyykko mipyykko changed the title Convert EmailTemplate relations Refactor EmailTemplate relations Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant