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

Initial schema sketch for email templates #6868

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scotttrinh
Copy link
Contributor

@scotttrinh scotttrinh commented Feb 16, 2024

Some discussion points:

  1. Should the fallback template be encoded in the schema (seems messy...) or in the rendering code?
  2. Should we relate the SMTPConfig to these templates somehow?
  3. Somewhat related: I wonder if there is a way to require SMTPConfig if you have any of the email factors enabled? 🤔

@scotttrinh scotttrinh force-pushed the auth-email-templates branch 2 times, most recently from 97adb84 to 4b2c5f9 Compare February 16, 2024 17:13
Comment on lines +302 to +315
create type ext::auth::EmailTemplate extending cfg::ConfigObject {
create required property subject: std::str {
create annotation std::description :=
"Subject of the email.";
};
create required property html: std::str {
create annotation std::description :=
"Body of the email.";
};
create required property plain_text: std::str {
create annotation std::description :=
"Body of the email in plain text.";
};
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elprans I wanted to check and see if this is what you had in mind based on our discussion earlier today:

Suggested change
create type ext::auth::EmailTemplate extending cfg::ConfigObject {
create required property subject: std::str {
create annotation std::description :=
"Subject of the email.";
};
create required property html: std::str {
create annotation std::description :=
"Body of the email.";
};
create required property plain_text: std::str {
create annotation std::description :=
"Body of the email in plain text.";
};
};
create type ext::auth::EmailTemplate extending cfg::ConfigObject {
create required property purpose: std::str {
create constraint exclusive;
};
create required property subject: std::str {
create annotation std::description :=
"Subject of the email.";
};
create required property html: std::str {
create annotation std::description :=
"Body of the email.";
};
create required property plain_text: std::str {
create annotation std::description :=
"Body of the email in plain text.";
};
};

And then adding multi email_templates: ext::auth::EmailTemplate; to the existing AuthConfig object?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One advantage of the original link approach is that we can populate some default and make them required for robustness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about default here, but I was wondering if a huge blob of HTML is really something we want to have in the schema. Also might be nice to have the default HTML be something that we "upgrade" over time without having to require a schema change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants