[New] SmtpMailer now understands whitelists for override
This commit is contained in:
parent
58248058e5
commit
a618fff095
|
@ -97,11 +97,11 @@ public class SmtpMailer {
|
|||
String fromName = properties.getProperty("fromName", null);
|
||||
this.from = new InternetAddress(fromAddr, fromName);
|
||||
|
||||
if (properties.containsKey("overrideRecipients")) {
|
||||
if (!properties.containsKey("overrideRecipients")) {
|
||||
this.overrideRecipients = null;
|
||||
} else {
|
||||
String addr = properties.getProperty("overrideRecipients", null);
|
||||
this.overrideRecipients = InternetAddress.parse(addr);
|
||||
} else {
|
||||
this.overrideRecipients = null;
|
||||
}
|
||||
|
||||
if (!properties.containsKey("recipientWhitelist")) {
|
||||
|
@ -179,8 +179,11 @@ public class SmtpMailer {
|
|||
}
|
||||
|
||||
if (!allowList.isEmpty()) {
|
||||
send(subject, text, parseAddress(recipients));
|
||||
logger.info(MessageFormat.format("Sent E-mail to {0}: {1}", recipients, subject));
|
||||
InternetAddress[] arr = new InternetAddress[allowList.size()];
|
||||
allowList.toArray(arr);
|
||||
send(subject, text, arr);
|
||||
logger.info(
|
||||
MessageFormat.format("Sent E-mail to white list recipient {0}: {1}", recipients, subject));
|
||||
}
|
||||
|
||||
if (needsOverrides) {
|
||||
|
|
Loading…
Reference in New Issue