diff options
Diffstat (limited to 'juick-api/src/main/java')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/EmailManager.java | 8 |
1 files changed, 6 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 6ba790d3..0093413e 100644 --- a/juick-api/src/main/java/com/juick/api/EmailManager.java +++ b/juick-api/src/main/java/com/juick/api/EmailManager.java @@ -6,6 +6,7 @@ import com.juick.server.util.HttpBadRequestException; import com.juick.service.EmailService; import com.juick.service.MessagesService; import com.juick.service.SubscriptionService; +import com.juick.service.UserService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,6 +35,8 @@ public class EmailManager implements ApplicationListener<MessageEvent> { SubscriptionService subscriptionService; @Inject MessagesService messagesService; + @Inject + UserService userService; @Override public void onApplicationEvent(MessageEvent event) { Message msg = event.getMessage(); @@ -75,8 +78,9 @@ public class EmailManager implements ApplicationListener<MessageEvent> { message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(email)); message.setSubject(subject); message.setText(String.format("%s\n%s\n\n---\nYou are receiving this because you are subscribed to this user " + - "or discussion. Configure notifications at https://juick.com/settings", - StringUtils.isNotEmpty(msg.getText()) ? formatPost(msg) : "", formatUrl(msg))); + "or discussion. Configure notifications at https://juick.com/settings?hash=%s", + StringUtils.isNotEmpty(msg.getText()) ? formatPost(msg) : "", formatUrl(msg), + userService.getHashByUID(userService.getUserByEmail(email).getUid()))); message.saveChanges(); transport.connect(); transport.sendMessage(message, message.getAllRecipients()); |