Merge branch 'bug3785'

This commit is contained in:
Axel Uhl committed 2016-07-21 13:11:47 +02:00
commit 5d062c2d71
3 files changed
+103 -55

No files matched your search

@@ -1,30 +1,40 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>${title}</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
.linkButton:active{padding:15px;margin:10px 10px 0px 0px;display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none}
.linkButton:visited{padding:15px;margin:10px 10px 0px 0px;display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none}
.linkButton:hover{background-color:#2b618e;border:1px solid #204d74}
</style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" bgcolor="#e3e3e3" offset="0" leftmargin="0" style="background-color: #e3e3e3;">
<div class="body" style="background-color:#e3e3e3;color:black;padding:40px;max-width:800px;margin:0 auto;margin-bottom:100px;font-family:'Open Sans', sans-serif">
<div class="main" style="border:1px solid black;background-color:white">
<div class="header" style="background-color:black;padding:10px;font-size:16px;border-bottom:.2em solid #efaa00;color:white">
<img src="cid:saplogo" class="sapLogo" alt="SAP " style="height:30px;width:auto;vertical-align:middle"><span class="sailingAnalytics" style="display:inline-block;line-height:30px;vertical-align:middle">Sailing Analytics</span>
</div>
<div class="content" style="margin:10px;padding:20px 30px;min-height:200px">
${content}
</div>
</div>
<div class="footer" style="margin:30px 10% 200px 10%;text-align:center;font-size:13px">
<p>${subscription_information}</p>
<p>${site}</p>
<p>${footer_links}</p>
</div>
</div>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>${title}</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style>
.linkButton:active{display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none}
.linkButton:visited{display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none}
.linkButton:hover{background-color:#2b618e;border:1px solid #204d74}
</style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" bgcolor="#e3e3e3" offset="0" leftmargin="0" style="background-color: #e3e3e3;">
<div class="body" style="background-color:#e3e3e3;color:black;padding:40px;max-width:800px;margin:0 auto;margin-bottom:100px;font-family:'Open Sans', sans-serif">
<div class="main" style="border:1px solid black">
<div class="headerWrapper" style="background-color:black;font-size:16px;border-bottom:.2em solid #efaa00;color:white">
<div class="header" style="border:10px solid black">
<img src="cid:saplogo" class="sapLogo" alt="SAP" style="height:30px;width:auto;float:left"><span class="sailingAnalytics" style="display:inline-block;line-height:16px;border-top:7px solid black;border-bottom:7px solid black;border-left:5px solid black">Sailing Analytics</span>
<div class="clear" style="clear:both"></div>
</div>
</div>
<div class="contentWrapper" style="background-color:white">
<div class="content" style="border:20px solid white;border-right:30px solid white;border-left:30px solid white;min-height:200px">
${content}
<div class="buttons" style="border-top:15px solid white;border-bottom:15px solid white">
${buttons}
</div>
</div>
<div class="clear" style="clear:both"></div>
</div>
</div>
<div class="footer" style="margin:30px 10% 200px 10%;text-align:center;font-size:13px">
<p>${subscription_information}</p>
<p>${site}</p>
<p>${footer_links}</p>
</div>
</div>
</body>
</html>
@@ -9,17 +9,17 @@
<title>${title}</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<style type="text/css">
.content {
margin: 10px;
.buttons {
border-top: 15px solid white;
border-bottom: 15px solid white;
}
.buttonContainer {
display: inline-block;
float: left;
border-top: 10px solid white;
border-right: 10px solid white;
}
.linkButton, .linkButton:active, .linkButton:visited {
padding: 15px;
margin: 10px 10px 0px 0px;
display: inline-block;
background-color: #337ab7;
border-radius: 4px;
@@ -28,6 +28,12 @@
text-decoration: none;
}
.linkButtonContent {
border: 15px solid #337ab7;
display: inline-block;
background-color: #337ab7;
}
.linkButton:hover {
background-color: #2b618e;
border: 1px solid #204d74;
@@ -45,19 +51,27 @@
.main {
border: 1px solid black;
background-color: white;
}
.header {
.headerWrapper {
background-color: black;
padding: 10px;
font-size: 16px;
border-bottom: .2em solid #efaa00;
color: white;
}
.header {
border: 10px solid black;
}
.contentWrapper {
background-color: white;
}
.content {
padding: 20px 30px;
border: 20px solid white;
border-right: 30px solid white;
border-left: 30px solid white;
min-height: 200px;
}
@@ -70,24 +84,44 @@
.sapLogo {
height: 30px;
width: auto;
vertical-align: middle;
float: left;
}
.sailingAnalytics {
display: inline-block;
line-height: 30px;
vertical-align: middle;
line-height: 16px;
border-top: 7px solid black;
border-bottom: 7px solid black;
border-left: 5px solid black;
}
.clear {
clear: both;
}
.paragraph {
border-top: 5px solid white;
border-bottom: 5px solid white;
}
</style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" bgcolor="#e3e3e3" offset="0" leftmargin="0" style="background-color: #e3e3e3;">
<div class="body">
<div class="main">
<div class="header">
<img src="cid:saplogo" class="sapLogo" alt="SAP "/><span class="sailingAnalytics">Sailing Analytics</span>
<div class="headerWrapper">
<div class="header">
<img src="cid:saplogo" class="sapLogo" alt="SAP"/><span class="sailingAnalytics">Sailing Analytics</span>
<div class="clear"></div>
</div>
</div>
<div class="content">
${content}
<div class="contentWrapper">
<div class="content">
${content}
<div class="buttons">
${buttons}
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="footer">
@@ -81,7 +81,7 @@ public abstract class NotificationSetNotification<T> implements MailNotification
// send batches with the actual mail addresses as bcc?
associatedNotificationSet.forUsersWithVerifiedEmailMappedTo(objectToNotifyAbout, (user) -> {
Locale locale = user.getLocaleOrDefault();
Multipart multipart = new MimeMultipart();
Multipart multipart = new MimeMultipart("alternative");
BodyPart bodyPart = new MimeBodyPart();
BodyPart messageImagePart = new MimeBodyPart();
try {
@@ -112,20 +112,23 @@ public abstract class NotificationSetNotification<T> implements MailNotification
.append("</h1>");
}
String name = user.getFullName() == null || user.getFullName().isEmpty() ? user.getName() : user.getFullName();
bodyContent.append("<p>")
bodyContent.append("<div class=\"paragraph\" style=\" border-top: 5px solid white; border-bottom: 5px solid white;\">")
.append(htmlify(messages.get(locale, "salutation", name)))
.append("</p>");
bodyContent.append("<p>")
.append("</div>");
bodyContent.append("<div class=\"paragraph\" style=\" border-top: 5px solid white; border-bottom: 5px solid white;\">")
.append(htmlify(notificationMailTemplate.getText()))
.append("</p>");
.append("</div>");
StringBuilder buttons = new StringBuilder();
for (Pair<String, String> link : notificationMailTemplate.getLabelsAndLinkUrls()) {
bodyContent.append("<div class=\"buttonContainer\">")
buttons.append("<span class=\"buttonContainer\" style=\"float: left; border-top: 10px solid white; border-right: 10px solid white;\">")
.append("<a class=\"linkButton\" href=\"")
.append(link.getB())
.append("\" style=\"padding:15px;margin:10px 10px 0px 0px;display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none;\">")
.append("\" style=\"display:inline-block;background-color:#337ab7;border-radius:4px;color:#ffffff;border:1px solid #2e6da4;text-decoration:none;\">")
.append("<span class=\"linkButtonContent\" style=\"border:15px solid #337ab7;display:inline-block;background-color: #337ab7;\">")
.append(htmlify(link.getA()))
.append("</a>")
.append("</div>");
.append("</span>")
.append("</a> ")
.append("</span>");
}
String siteLink = "<a href=\"" + notificationMailTemplate.getServerBaseUrl() + "/gwt/Home.html\">"
+ notificationMailTemplate.getServerBaseUrl() + "</a>";
@@ -148,6 +151,7 @@ public abstract class NotificationSetNotification<T> implements MailNotification
return TEMPLATE
.replace("${title}", notificationMailTemplate.getSubject())
.replace("${content}", bodyContent.toString())
.replace("${buttons}", buttons.toString())
.replace("${subscription_information}", subscriptionInformation)
.replace("${site}", siteLink) //
.replace("${footer_links}", footerLinks.toString())