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
Fixes #19147: Email notification should be disabled when no host server is configured #360
Conversation
emailBody <- getContentFromTemplate(mf, emailConf, params) | ||
emailSubject <- getSubjectFromTemplate(mf, emailConf.subject, params) | ||
_ <- emailService.sendEmail(serverConfig, emailConf.toEnvelop(emailBody).copy(subject = emailSubject)) | ||
_ <- ZIO.when(!serverConfig.smtpHostServer.isBlank) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEmpty not isBlank (we still support some old Java8 systems that does not support isBlank
5d75b3e
to
4a648cb
Compare
Commit modified |
emailSubject <- getSubjectFromTemplate(mf, emailConf.subject, params) | ||
_ <- emailService.sendEmail(serverConfig, emailConf.toEnvelop(emailBody).copy(subject = emailSubject)) | ||
_ <- ZIO.when(serverConfig.smtpHostServer.nonEmpty) { | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be an info log line in each case - oh, no the config is read on each notification.
OK, we need to add the info in the plugin page in a next version. (ie in the plugin page, something like "Email notification are [disabled (configure email server in /... to enable) | enable (comment config in .... to disable) ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we want to log whether active or not when we try to send an email ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but I forgot that we reread conf each time, so it would hard to spot when it changes from enable to disable (or opposite).
So in place of having a log when the config is read, we need to display the info somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update documentation of the plugin to reflect that change in behavior
4a648cb
to
5c6f211
Compare
Commit modified |
5c6f211
to
9ab2a2a
Compare
Commit modified |
9ab2a2a
to
8b1bc88
Compare
Moved to #364 |
https://issues.rudder.io/issues/19147