Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor emails #408

Merged
merged 24 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a8083d2
Refactor change place status email.
IliaWithHat Sep 30, 2024
38b3e03
Refactor create-employee-password-page.html email.
IliaWithHat Sep 30, 2024
3e0229b
Refactor habit-assign-friend-request.html email.
IliaWithHat Sep 30, 2024
50948a9
Removed unused new-event-comment-email-page.html
IliaWithHat Oct 2, 2024
e27c665
Removed unused user-received-comment-email-page.html and user-receive…
IliaWithHat Oct 2, 2024
6e171fb
Refactor new-places-report-email-page.html
IliaWithHat Oct 2, 2024
bb1a256
Refactor restore-email-page.html
IliaWithHat Oct 2, 2024
e052fda
Refactor scheduled-notification-email-page.html
IliaWithHat Oct 2, 2024
1e19397
Refactor success-restored-password-page.html
IliaWithHat Oct 2, 2024
b8b43df
Refactor user-activation-page.html
IliaWithHat Oct 2, 2024
aee69d8
Refactor user-approval-email-page.html
IliaWithHat Oct 2, 2024
2f2b663
Remove dumb code.
IliaWithHat Oct 2, 2024
e0cf3b3
Remove unnecessary validation.
IliaWithHat Oct 2, 2024
3a6095a
Merge refactor-email in dev.
IliaWithHat Oct 3, 2024
3d01afc
Fix.
IliaWithHat Oct 3, 2024
7c1ce9f
Fix.
IliaWithHat Oct 3, 2024
479f9f2
Merge refactor-emails in dev.
IliaWithHat Oct 3, 2024
48385f3
Refactored user-reasons-of-deactivation-page.html
IliaWithHat Oct 3, 2024
a446255
Refactored user-violation-mail.html
IliaWithHat Oct 3, 2024
c2186e4
Refactored verify-email-page.html
IliaWithHat Oct 3, 2024
9af2739
Cleanup.
IliaWithHat Oct 3, 2024
9b33483
Fix test.
IliaWithHat Oct 3, 2024
4125af7
Changed logo for Pick Up City and fixing sincerely text.
IliaWithHat Oct 4, 2024
dfe26a6
Removed duplication.
IliaWithHat Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/greencity/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
"/email/sendInterestingEcoNews",
"/email/changePlaceStatus",
"/email/general/notification",
"/email/habitAssign/notification",
"/email/sendHabitAssignNotification",
"/email/taggedUserInComment/notification",
"/email/userReceivedComment/notification",
"/email/userReceivedCommentReply/notification")
Expand Down
13 changes: 3 additions & 10 deletions core/src/main/java/greencity/controller/EmailController.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,25 @@ public ResponseEntity<Object> sendInterestingEcoNews(@RequestBody InterestingEco
* added new places.
*
* @param message - object with all necessary data for sending email
* @author Taras Kavkalo
*/
@PostMapping("/sendReport")
public ResponseEntity<Object> sendReport(@RequestBody SendReportEmailMessage message) {
emailService.sendAddedNewPlacesReportEmail(message.getSubscribers(), message.getCategoriesDtoWithPlacesDtoMap(),
message.getEmailNotification());
emailService.sendAddedNewPlacesReportEmail(message);
return ResponseEntity.ok().build();
}

/**
* Method for sending simple notification to {@code User} about status change.
*
* @param message - object with all necessary data for sending email
* @author Taras Kavkalo
*/
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = HttpStatuses.OK),
@ApiResponse(responseCode = "400", description = HttpStatuses.BAD_REQUEST),
})
@PostMapping("/changePlaceStatus")
public ResponseEntity<Object> changePlaceStatus(@RequestBody @Valid SendChangePlaceStatusEmailMessage message) {
emailService.sendChangePlaceStatusEmail(message.getAuthorFirstName(), message.getPlaceName(),
message.getPlaceStatus(), message.getAuthorEmail());
public ResponseEntity<Object> changePlaceStatus(@RequestBody @Valid ChangePlaceStatusDto message) {
emailService.sendChangePlaceStatusEmail(message);
return ResponseEntity.ok().build();
}

Expand All @@ -69,7 +65,6 @@ public ResponseEntity<Object> changePlaceStatus(@RequestBody @Valid SendChangePl
*
* @param sendHabitNotification - object with all necessary data for sending
* email
* @author Taras Kavkalo
*/
@PostMapping("/sendHabitNotification")
public ResponseEntity<Object> sendHabitNotification(@RequestBody SendHabitNotification sendHabitNotification) {
Expand All @@ -82,7 +77,6 @@ public ResponseEntity<Object> sendHabitNotification(@RequestBody SendHabitNotifi
*
* @param dto {@link UserViolationMailDto} - object with all necessary data for
* sending email.
* @author Zakhar Veremchuk
*/
@PostMapping("/sendUserViolation")
public ResponseEntity<Object> sendUserViolation(@RequestBody UserViolationMailDto dto) {
Expand All @@ -95,7 +89,6 @@ public ResponseEntity<Object> sendUserViolation(@RequestBody UserViolationMailDt
*
* @param message {@link ScheduledEmailMessage} - object with all necessary data
* for sending notification via email.
* @author Dmytro Dmytruk
*/
@Operation(summary = "Send scheduled email notification to user")
@ApiResponses(value = {
Expand Down
35 changes: 19 additions & 16 deletions core/src/main/resources/messages_en.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hello=Hi
hi.user=Hi {0},
restored.password = Restore password
password.reset = Password Reset
confirm.restoring.pass = Confirm restoring password
Expand All @@ -8,34 +8,37 @@ thanksUbs=Thanks for joining Pick Up City!
text.restore=Your password has just been reset. To confirm reset your password, we need you to follow the link within 24 hours.
restore=Change password
text.reset=Your password has been successfully changed!
condition=If the button does not work, just paste this link into your browser:
advice.reset=You received this email because you changed your password. If you didn't do it, change your password as soon as possible.
advice=You received this email because we received a request for restoring your password. If you didn't request this action you can safely delete this email.
advice.registration=You received this email because we received a request for registration. If you didn't request this action you can safely delete this email.
verify=Verify your email!
email=Verify me!
text.verify=To complete your registration, please click the button below.
profile=To profile
profile=Go to profile
text.footer=Green city greencity@gmail.com UBS UBS@gmail.com All rights are reserved
verify.email=Verify your email address
habit.friend.request=Invitation to join a habit from a friend
friend.request=Invitation to join a habit
text.friend.request=In order to confirm the invitation from
click.button=click on the button below
button.friend.request=Accept the invitation
creating.new.passwordUbs=Creating new password for Pick Up City
creating.new.password=Creating new password for Green City
passwordUbs=Create new password for Pick Up City
password.new=Create new password for Green City
text.create.pass=Click the button below to create a password for your account:
create=Create password
advice.employee=You received this email due to a request to create a new employee account. If you did not request this action you can safely delete this email.
user.tagged.request=You have been mentioned in the comment to the
user.received.comment.request=You have been received comment to the
user.received.comment.reply.request=replied to your comment to the
interesting.news.subject=Interesting Eco News
interesting.news.hello=Hi {0},
interesting.news.main.text=Here are the most interesting eco news that our authors wrote this week.
interesting.news.sincerely.yours=Sincerely yours, GreenCity's team.
unsubscribe.text=If you no longer wish to receive these emails, you can
change.place.status.subject=Proposed place status changed
change.place.status.you.proposed=Your proposed place "{0}" has been {1}.
change.place.status.approved=approved
change.place.status.declined=declined
change.place.status.view.it=Now, you can view it in
notifications.button=Go to notifications
user.activation.subject=Your account was activated
user.activation.advice=You received this email because your account was activated.
user.deactivation.subject=Your account was deactivated
user.deactivation.text=Your account has been deactivated for this reason:
user.deactivation.advice=If you think this is a mistake, then contact the administration.
user.violation.subject=You get a violation
user.violation.text=You get violation:
sincerely.yours.greenCity=Sincerely yours, Green City team.
sincerely.yours.Ubs=Sincerely yours, Pick Up City team.
unsubscribe.text=If you no longer wish to receive these emails, you can
unsubscribe=unsubscribe
read.more=READ MORE
Loading
Loading