-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20025 add partner locations to email template
- Loading branch information
1 parent
c5d662e
commit 30ab900
Showing
7 changed files
with
207 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.kontur.disasterninja.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.util.Set; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class Partner { | ||
private String name; | ||
private int totalLocations; | ||
private Set<String> locations; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 102 additions & 32 deletions
134
src/main/resources/notification/gg-email-template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,114 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>${name}</title> | ||
<title th:text="${name}">Event Notification</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.container { | ||
max-width: 600px; | ||
margin: 10px auto; | ||
} | ||
h3 { | ||
font-size: 18px; | ||
margin-bottom: 8px; | ||
} | ||
p, li { | ||
font-size: 14px; | ||
line-height: 1.5; | ||
} | ||
.button-link { | ||
display: block; | ||
padding: 8px; | ||
width: 180px; | ||
background-color: #4A90E2; | ||
color: #ffffff !important; | ||
text-decoration: none; | ||
font-size: 14px; | ||
text-align: center; | ||
border-radius: 4px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); | ||
} | ||
.button-link:hover { | ||
background-color: #3B73B5; | ||
color: #ffffff !important; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="section"> | ||
<h3>🌍 Event Overview:</h3> | ||
<p>View the event on <a href="${link}" target="_blank">globalgiving.kontur.io</a>.</p> | ||
<p>${description}</p> | ||
</div> | ||
<div class="container"> | ||
<div class="section"> | ||
<h3>DISASTER ALERT</h3> | ||
<p th:text="${description}"></p> | ||
<a th:href="${link}" target="_blank" class="button-link">View Full Event Details</a> | ||
</div> | ||
|
||
<div class="section"> | ||
<h3>👥 Impact Summary:</h3> | ||
<ul> | ||
<li><strong>Urban core:</strong> ${urbanPopulation} people on ${urbanArea} km².</li> | ||
<li><strong>Total population:</strong> ${population} people on ${populatedArea} km².</li> | ||
<li><strong>Industrial area:</strong> ${industrialArea} km².</li> | ||
<li><strong>Forest area:</strong> ${forestArea} km².</li> | ||
<li><strong>Location:</strong> ${location}</li> | ||
</ul> | ||
</div> | ||
<div class="section" th:if="${urbanPopulation != null && urbanArea != null || population != null && populatedArea != null || industrialArea != null || forestArea != null}"> | ||
<h3>👥 Impact Summary</h3> | ||
<ul> | ||
<li th:if="${urbanPopulation != null && urbanArea != null}"> | ||
<strong>Urban core:</strong> <span th:text="${urbanPopulation}"></span> people on <span th:text="${urbanArea}"></span> km² | ||
</li> | ||
<li th:if="${population != null && populatedArea != null}"> | ||
<strong>Total population:</strong> <span th:text="${population}"></span> people on <span th:text="${populatedArea}"></span> km² | ||
</li> | ||
<li th:if="${industrialArea != null}"> | ||
<strong>Industrial area:</strong> <span th:text="${industrialArea}"></span> km² | ||
</li> | ||
<li th:if="${forestArea != null}"> | ||
<strong>Forest area:</strong> <span th:text="${forestArea}"></span> km² | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="section"> | ||
<h3>🗓️ Event Status:</h3> | ||
<ul> | ||
<li><strong>Type:</strong> ${type}</li> | ||
<li><strong>Severity:</strong> ${severity}</li> | ||
<li><strong>Start Date:</strong> ${startedAt}</li> | ||
<li><strong>Latest Update:</strong> ${updatedAt}</li> | ||
</ul> | ||
</div> | ||
<div class="section" th:if="${type != null || severity != null || startedAt != null || updatedAt != null || location != null}"> | ||
<h3>🗓️ Event Status</h3> | ||
<ul> | ||
<li th:if="${type != null}"> | ||
<strong>Type:</strong> <span th:text="${type}"></span> | ||
</li> | ||
<li th:if="${severity != null}"> | ||
<strong>Severity:</strong> <span th:text="${severity}"></span> | ||
</li> | ||
<li th:if="${location != null}"> | ||
<strong>Location:</strong> <span th:text="${location}"></span> | ||
</li> | ||
<li th:if="${startedAt != null}"> | ||
<strong>Start Date:</strong> <span th:text="${startedAt}"></span> | ||
</li> | ||
<li th:if="${updatedAt != null}"> | ||
<strong>Latest Update:</strong> <span th:text="${updatedAt}"></span> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="section"> | ||
<h3>✉️ Need Help?</h3> | ||
<p>For any questions or issues, feel free to contact us at | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
<div class="section" th:if="${partners != null && #lists.size(partners) > 0}"> | ||
<h3>🏢 Affected Partner Locations</h3> | ||
<ul> | ||
<li th:each="partner : ${partners}"> | ||
Partner <strong><span th:text="${partner.name}"></span></strong> has <span th:text="${partner.totalLocations}"></span> affected location<span th:if="${partner.totalLocations > 1}">s</span>: | ||
<ul> | ||
<li th:each="partnerLocation, iterStat : ${partner.locations}"> | ||
<span th:if="${iterStat.index < 3}" th:text="${partnerLocation}"></span> | ||
<span th:if="${iterStat.index == 3}">See full list of locations on <a th:href="${link}" target="_blank">globalgiving.kontur.io</a></span> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<hr> | ||
|
||
<div class="section"> | ||
<p>For any questions or issues, feel free to contact us at | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.