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

Feat/notification sender #178

Merged
merged 2 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Go on the root folder and launch the following command:
* Full independent build: `docker build -t local/karnak:latest -f Dockerfile .`
* Build from compile package:
* `mvn clean install -P production`
* `docker build -t local/karnak:latest -f mvc/src/main/docker/Dockerfile .`
* `docker build -t local/karnak:latest -f src/main/docker/Dockerfile .`

## Run image from Docker Hub

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public class DefaultValuesNotification {
public static final String OBJECT_PATTERN = "[Karnak Notification] %s %.30s";
public static final String OBJECT_VALUES = "PatientID,StudyDescription";
public static final String INTERVAL = "45";
public static final String MAIL_SMTP_SENDER = "[email protected]";
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ protected PasswordAuthentication getPasswordAuthentication() {
Message msg = new MimeMessage(session);

// set the from and to address
InternetAddress addressFrom = new InternetAddress("[email protected]");
String senderAddr = config.getMailSmtpSender();
InternetAddress addressFrom = new InternetAddress(senderAddr);
msg.setFrom(addressFrom);

InternetAddress[] addressTo = new InternetAddress[emailList.size()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class GatewaySetUpService {
private final String mailAuthUser;
private final String mailAuthPwd;
private final String smtpPort;
private final String mailSmtpSender;

private final NotificationSetUp notificationSetUp;

Expand Down Expand Up @@ -124,6 +125,7 @@ public GatewaySetUpService(final ForwardNodeRepo forwardNodeRepo) throws Excepti

smtpHost = getProperty("MAIL_SMTP_HOST", null);
smtpPort = getProperty("MAIL_SMTP_PORT", null);
mailSmtpSender = getProperty("MAIL_SMTP_SENDER", DefaultValuesNotification.MAIL_SMTP_SENDER);
mailAuthType = getProperty("MAIL_SMTP_TYPE", null);
mailAuthUser = getProperty("MAIL_SMTP_USER", null);
mailAuthPwd = getProperty("MAIL_SMTP_SECRET", null);
Expand Down Expand Up @@ -240,6 +242,8 @@ public String getSmtpPort() {
return smtpPort;
}

public String getMailSmtpSender() { return mailSmtpSender; }

public NotificationSetUp getNotificationSetUp() {
return notificationSetUp;
}
Expand Down