Skip to content

Commit

Permalink
CLEAN NULL SUBJECT PREFIX
Browse files Browse the repository at this point in the history
Add condition to clean value if User choose not to have a Subject Prefix

Signed-off-by: Andres Tito <[email protected]>
  • Loading branch information
LaVibeX committed Jan 29, 2024
1 parent 2b6363f commit f0cf7c5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ private void sendNotification(final PublishContext ctx, Notification notificatio

final boolean smtpEnabled;
final String smtpFrom;
final String smtpPrefix;
final String smtpHostname;
final int smtpPort;
final String smtpUser;
final String encryptedSmtpPassword;
final boolean smtpSslTls;
final boolean smtpTrustCert;
String smtpPrefix;

try (QueryManager qm = new QueryManager()) {
smtpEnabled = qm.isEnabled(EMAIL_SMTP_ENABLED);
Expand All @@ -115,6 +115,7 @@ private void sendNotification(final PublishContext ctx, Notification notificatio

smtpFrom = qm.getConfigProperty(EMAIL_SMTP_FROM_ADDR.getGroupName(), EMAIL_SMTP_FROM_ADDR.getPropertyName()).getPropertyValue();
smtpPrefix = qm.getConfigProperty(EMAIL_PREFIX.getGroupName(), EMAIL_PREFIX.getPropertyName()).getPropertyValue();
smtpPrefix = smtpPrefix == null ? " " : smtpPrefix;
smtpHostname = qm.getConfigProperty(EMAIL_SMTP_SERVER_HOSTNAME.getGroupName(), EMAIL_SMTP_SERVER_HOSTNAME.getPropertyName()).getPropertyValue();
smtpPort = Integer.parseInt(qm.getConfigProperty(EMAIL_SMTP_SERVER_PORT.getGroupName(), EMAIL_SMTP_SERVER_PORT.getPropertyName()).getPropertyValue());
smtpUser = qm.getConfigProperty(EMAIL_SMTP_USERNAME.getGroupName(), EMAIL_SMTP_USERNAME.getPropertyName()).getPropertyValue();
Expand Down

0 comments on commit f0cf7c5

Please sign in to comment.