forked from External/mage
Changed that mailgun or smtp server can be used to send mails from server.
This commit is contained in:
parent
ba98d44772
commit
dcbe2da0e6
3 changed files with 30 additions and 7 deletions
|
|
@ -99,8 +99,15 @@ public class Session {
|
|||
return returnMessage;
|
||||
}
|
||||
AuthorizedUserRepository.instance.add(userName, password, email);
|
||||
if (MailClient.sendMessage(email, "XMage Registration Completed",
|
||||
"You are successfully registered as " + userName + ".")) {
|
||||
String subject = "XMage Registration Completed";
|
||||
String text = "You are successfully registered as " + userName + ".";
|
||||
boolean success;
|
||||
if (!ConfigSettings.getInstance().getMailUser().isEmpty()) {
|
||||
success = MailClient.sendMessage(email, subject, text);
|
||||
} else {
|
||||
success = MailgunClient.sendMessage(email, subject, text);
|
||||
}
|
||||
if (success) {
|
||||
logger.info("Sent a registration confirmation email to " + email + " for " + userName);
|
||||
} else {
|
||||
logger.error("Failed sending a registration confirmation email to " + email + " for " + userName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue