generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug/6593/fix send email for user in patch update status (#426)
* Fix email sending for user in PATCH updateStatus * Add test for sendPlaceStatusChange controller method * Add documentation for controller method * Format, checkstyle * Add test for sendPlaceStatusChangeNotification * Fix test * Add Ukrainian language to messages file * delete import mock* * Fix for comment from Vitaliy * checkstyle+formatter * Fix tests * The code has been changed according to Vitalii's feedback(delete not useg import, add swagger doc, add test for not found email, use static ErrorMessage) * add static test to constant
- Loading branch information
1 parent
c2a3807
commit 573a7b3
Showing
12 changed files
with
310 additions
and
6 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
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
105 changes: 105 additions & 0 deletions
105
core/src/main/resources/templates/email/place-status-change.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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!DOCTYPE html> | ||
<html th:lang="${language}"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
background-color: #F5F6F6; | ||
} | ||
|
||
.email-container { | ||
font-family: Lato, sans-serif; | ||
font-size: 16px; | ||
width: 100%; | ||
max-width: 600px; | ||
margin: 0 auto; | ||
background-color: #E3E6E8; | ||
} | ||
|
||
.header { | ||
text-align: center; | ||
padding: 30px; | ||
background-color: #13AA57; | ||
} | ||
|
||
.header-image { | ||
height: 30px; | ||
vertical-align: bottom; | ||
} | ||
|
||
.content { | ||
padding: 26px; | ||
text-align: left; | ||
color: #333333 !important; | ||
} | ||
|
||
.top-text { | ||
margin-top: 0; | ||
color: #333333 !important; | ||
} | ||
|
||
.main-text { | ||
line-height: 1.4; | ||
color: #333333 !important; | ||
} | ||
|
||
.bottom-text { | ||
margin-bottom: 0; | ||
color: #333333 !important; | ||
} | ||
|
||
.footer { | ||
text-align: center; | ||
padding: 10px; | ||
font-size: 12px; | ||
color: #666666; | ||
background-color: #CACFD3; | ||
} | ||
|
||
@media only screen and (max-width: 600px) { | ||
body { | ||
font-size: 13px; | ||
} | ||
|
||
.header { | ||
padding: 20px; | ||
} | ||
|
||
.header-image { | ||
height: 25px; | ||
} | ||
|
||
.footer { | ||
font-size: 10px; | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="email-container"> | ||
<div class="header"> | ||
<a th:href="${clientLink}" target="_blank"> | ||
<img class="header-image" src="https://csb10032000a548f571.blob.core.windows.net/allfiles/5eaa9e18-f91f-4d3a-9926-da1239317a98GreenCity-Logo-White.png" alt="GreenCityLogo"> | ||
</a> | ||
</div> | ||
|
||
<div class="content"> | ||
<p class="top-text"> | ||
<b th:text="#{hi.user(${name})}"></b> | ||
</p> | ||
|
||
<p class="main-text"> | ||
The status of the place "<b th:text="${placeName}"></b>" has been updated to: <b th:text="${placeStatus}"></b>. | ||
</p> | ||
</div> | ||
|
||
<div class="footer"> | ||
<p class="bottom-text" th:text="#{your.place.status.changed}"></p> | ||
</div> | ||
</div> | ||
</body> | ||
</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
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
22 changes: 22 additions & 0 deletions
22
service-api/src/main/java/greencity/message/PlaceStatusChangeDto.java
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,22 @@ | ||
package greencity.message; | ||
|
||
import greencity.enums.PlaceStatus; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.*; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class PlaceStatusChangeDto { | ||
@NotNull | ||
private String placeName; | ||
|
||
@NotNull | ||
private PlaceStatus newStatus; | ||
|
||
@NotNull | ||
private String userName; | ||
|
||
@NotNull | ||
private String email; | ||
} |
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
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
Oops, something went wrong.