[FEAT] Quarterdeck welcome email body should be in template#50
Conversation
…the refactored EmailTemplate instead of using string content
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
* add to env.template * add email body templates for local development use * change a bunch of `conf` to `s.conf` * fix split_words issue on EmailTemplate * re-enable the QD_APP_BASE_URI env var for the app base URI because the audience may have multiple URL values which causes issues
| type AppConfig struct { | ||
| Name string `split_words:"true" default:"Quarterdeck" desc:"the descriptive name of the application"` | ||
| LogoURI string `split_words:"true" default:"https://rotational.ai/hs-fs/hubfs/Rotational%20Logo%20Hor%201073x280.png" desc:"the logo for the application"` | ||
| BaseURI string `split_words:"true" env:"QD_AUTH_AUDIENCE" desc:"base URL for the application"` |
There was a problem hiding this comment.
@bbengfort I had to remove the env:... here, as the auth audience might be multiple URLs, and we need just the App-related one. This will have to be refactored later when we do multiple Apps/Orgs anyways, so having some redundant config is just a problem we have to deal with for now I think.
Probably, later on we'll just collect the App.BaseURI's for all of the Apps we're supporting once we refactor to support multiple Apps, and append them together for the Auth.Audience value, or something like that. We can also use this base URI for the login, logout, and other related paths that we are currently manually entering into the config at the AuthConfig level.
|
|
||
| // Set the global level | ||
| zerolog.SetGlobalLevel(conf.GetLogLevel()) | ||
| zerolog.SetGlobalLevel(s.conf.GetLogLevel()) |
There was a problem hiding this comment.
All of the bare conf were turned into s.conf because conf might be nil for the new "global config" which was causing panics.
| // Loads the welcome email template content from the provided paths. Can be used | ||
| // concurrently. | ||
| func (p *EmailTemplate) LoadTemplateContent() (err error) { |
There was a problem hiding this comment.
I chose to do it this way rather than refactoring the commo template loading system to support something like this. In the future we may want to do more work on commo to support this there instead of in this config file.
Scope of changes
Refactored the
EmailTemplatePathsto justEmailTemplateand built it as a way to load the templates from the filesystem easily.Please also review the paired PR: https://github.com/rotationalio/endeavor/pull/311
Fixes SC-37123
Type of change
Acceptance criteria
I added a test for this, see the
app_test.gofile.Please also review this paired PR: https://github.com/rotationalio/endeavor/pull/311
Definition of Done
Reviewer(s) checklist