diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/EmailManager.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/juick-api/src/main/java/com/juick/api/EmailManager.java b/juick-api/src/main/java/com/juick/api/EmailManager.java index 8e868ca0..eca2dfa3 100644 --- a/juick-api/src/main/java/com/juick/api/EmailManager.java +++ b/juick-api/src/main/java/com/juick/api/EmailManager.java @@ -18,6 +18,7 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import static com.juick.formatters.PlainTextFormatter.formatPost; +import static com.juick.formatters.PlainTextFormatter.formatUrl; @Component public class EmailManager implements ApplicationListener<MessageEvent> { @@ -44,10 +45,12 @@ public class EmailManager implements ApplicationListener<MessageEvent> { Session session = Session.getDefaultInstance(System.getProperties()); try { MimeMessage message = new MimeMessage(session); - message.setFrom(new InternetAddress("noreply@mail.juick.com")); + message.setFrom(new InternetAddress("juick@juick.com")); message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(email)); message.setSubject(String.format("New message from %s", msg.getUser().getName())); - message.setText(formatPost(msg)); + message.setText(String.format("%s\n%s\n---\nYou are receiving this because you are subscribed to this user " + + "or discussion. Configure notifications at https://juick.com/settings", + formatPost(msg), formatUrl(msg))); Transport.send(message); } catch (MessagingException ex) { logger.error("mail exception", ex); |