Sending Emails through AWS SES (#32)
This commit is contained in:
@ -22,9 +22,16 @@ public class EmailService {
|
|||||||
// Create a Simple MailMessage.
|
// Create a Simple MailMessage.
|
||||||
SimpleMailMessage message = new SimpleMailMessage();
|
SimpleMailMessage message = new SimpleMailMessage();
|
||||||
message.setTo(email);
|
message.setTo(email);
|
||||||
String carbonCopyEmail = environment.getProperty("spring.mail.username");
|
|
||||||
|
String fromEmail = environment.getProperty("app.email.from");
|
||||||
|
if (fromEmail == null) fromEmail = environment.getProperty("spring.mail.username");
|
||||||
|
message.setFrom(fromEmail);
|
||||||
|
|
||||||
|
String carbonCopyEmail = environment.getProperty("app.email.carbon-copy");
|
||||||
|
if (carbonCopyEmail == null) carbonCopyEmail = environment.getProperty("spring.mail.username");
|
||||||
log.debug("Carbon Copy Email: {}", carbonCopyEmail);
|
log.debug("Carbon Copy Email: {}", carbonCopyEmail);
|
||||||
message.setCc(carbonCopyEmail);
|
message.setCc(carbonCopyEmail);
|
||||||
|
|
||||||
message.setSubject(EMAIL_SUBJECT);
|
message.setSubject(EMAIL_SUBJECT);
|
||||||
message.setText("Hello " + firstName + "!\n\nYour new account password is: " + password + "\n\nThe Support Team");
|
message.setText("Hello " + firstName + "!\n\nYour new account password is: " + password + "\n\nThe Support Team");
|
||||||
|
|
||||||
|
|||||||
@ -68,10 +68,21 @@ spring:
|
|||||||
url: jdbc:mysql://localhost:3306/support_portal
|
url: jdbc:mysql://localhost:3306/support_portal
|
||||||
username: support_portal_user
|
username: support_portal_user
|
||||||
password: Supp0rt_Porta!_P@ssword
|
password: Supp0rt_Porta!_P@ssword
|
||||||
|
mail:
|
||||||
|
host: email-smtp.eu-north-1.amazonaws.com
|
||||||
|
port: 587
|
||||||
|
username: AKIAVW7XGDOWFHHCELIH
|
||||||
|
password: BJyWOWS1xWYR35MRCFn3BuuQ6vY+k7DRsdAvOfqDs/Fk
|
||||||
|
|
||||||
# we want to test (1) from localhost, (2) from S3 bucket Static Web Site, (3) from our EC2 instance
|
# we want to test (1) from localhost, (2) from S3 bucket Static Web Site, (3) from our EC2 instance
|
||||||
app:
|
app:
|
||||||
|
email:
|
||||||
|
from: d.art.shishkin@gmail.com
|
||||||
|
carbon-copy: d.art.shishkin@gmail.com
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: http://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com,http://support-portal.shyshkin.net
|
allowed-origins: http://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com,http://support-portal.shyshkin.net
|
||||||
server:
|
server:
|
||||||
port: 5000
|
port: 5000
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
net.shyshkin: debug
|
||||||
Reference in New Issue
Block a user