From fdb9d0e4569eab3a5b4ddf7f63f5e505249b8ac3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 6 Jan 2018 09:18:49 +0300 Subject: email: cleanup html template --- juick-api/src/main/java/com/juick/api/EmailManager.java | 2 +- juick-core/src/main/java/com/juick/util/MessageUtils.java | 6 +++--- 2 files changed, 4 insertions(+), 4 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 2ada6ab9..1c105ef9 100644 --- a/juick-api/src/main/java/com/juick/api/EmailManager.java +++ b/juick-api/src/main/java/com/juick/api/EmailManager.java @@ -83,7 +83,7 @@ public class EmailManager implements ApplicationListener { StringUtils.isNotEmpty(msg.getText()) ? formatPost(msg) : "", formatUrl(msg)); MimeBodyPart textBodyPart = new MimeBodyPart(); textBodyPart.setContent(plainText, "text/plain; charset=UTF-8"); - String htmlText = String.format("%s

--
You are receiving this because you are subscribed to this user " + + String htmlText = String.format("%s

--
You are receiving this because you are subscribed to this user" + ", discussion or tag. Reply to this email directly or view it on Juick." + "
Configure or disable notifications", StringUtils.isNotEmpty(msg.getText()) ? MessageUtils.formatHtml(msg) : "", formatUrl(msg), diff --git a/juick-core/src/main/java/com/juick/util/MessageUtils.java b/juick-core/src/main/java/com/juick/util/MessageUtils.java index 91cc7870..d032ce8e 100644 --- a/juick-core/src/main/java/com/juick/util/MessageUtils.java +++ b/juick-core/src/main/java/com/juick/util/MessageUtils.java @@ -146,11 +146,11 @@ public class MessageUtils { public static String formatHtml(Message jmsg) { StringBuilder sb = new StringBuilder(); boolean isReply = jmsg.getRid() > 0; - String title = isReply ? "

Reply by @" : "@"; - String subtitle = isReply ? "" + jmsg.getReplyQuote() + "" : "" + jmsg.getTagsString() + ""; + String title = isReply ? "Reply by @" : "@"; + String subtitle = isReply ? "
" + jmsg.getReplyQuote() + "
" : "" + jmsg.getTagsString() + ""; boolean isCode = jmsg.getTags().stream().anyMatch(t -> t.getName().equals("code")); - sb.append(title).append(jmsg.getUser().getName()).append(":


") + sb.append(title).append(jmsg.getUser().getName()).append(":

") .append(subtitle).append("
") .append(isCode ? formatMessageCode(jmsg.getText()) : formatMessage(jmsg.getText())).append("
"); if (StringUtils.isNotEmpty(jmsg.getAttachmentType())) { -- cgit v1.2.3