From 9d4141452ffb2ca031491055e84ffb476c06422f Mon Sep 17 00:00:00 2001 From: IliaWithHat Date: Tue, 8 Oct 2024 21:42:32 +0300 Subject: [PATCH] Done. --- core/src/main/resources/messages_en.properties | 4 ++-- core/src/main/resources/messages_uk.properties | 4 ++-- .../email/change-place-status-email-page.html | 2 +- .../email/new-places-report-email-page.html | 2 +- .../email/scheduled-notification-email-page.html | 2 +- .../java/greencity/constant/EmailConstants.java | 1 + .../java/greencity/service/EmailServiceImpl.java | 13 +++++++------ 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/core/src/main/resources/messages_en.properties b/core/src/main/resources/messages_en.properties index bdbe8fec2..2805260b6 100644 --- a/core/src/main/resources/messages_en.properties +++ b/core/src/main/resources/messages_en.properties @@ -39,6 +39,6 @@ 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 +unsubscribe.text=If you no longer wish to receive these emails, you can unsubscribe from them in your +unsubscribe.profile=profile read.more=READ MORE \ No newline at end of file diff --git a/core/src/main/resources/messages_uk.properties b/core/src/main/resources/messages_uk.properties index 49b14ceb6..66fa0d541 100644 --- a/core/src/main/resources/messages_uk.properties +++ b/core/src/main/resources/messages_uk.properties @@ -39,6 +39,6 @@ user.violation.subject=\u0412\u0438\u0020\u043e\u0442\u0440\u0438\u043c\u0443\u0 user.violation.text=\u0412\u0438\u0020\u043e\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u0435\u0020\u043f\u043e\u0440\u0443\u0448\u0435\u043d\u043d\u044f: sincerely.yours.greenCity=\u0429\u0438\u0440\u043e\u0020\u0432\u0430\u0448\u0430\u002c\u0020\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0020\u0047\u0072\u0065\u0065\u006e\u0020\u0043\u0069\u0074\u0079\u002e sincerely.yours.Ubs=\u0429\u0438\u0440\u043e\u0020\u0432\u0430\u0448\u0430\u002c\u0020\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0020\u0050\u0069\u0063\u006b\u0020\u0055\u0070\u0020\u0043\u0069\u0074\u0079\u002e -unsubscribe.text=\u042f\u043a\u0449\u043e \u0432\u0438 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0435 \u043e\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u0442\u0438 \u0440\u043e\u0437\u0441\u0438\u043b\u043a\u0443\u002c \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 -unsubscribe=\u0432\u0456\u0434\u043f\u0438\u0441\u0430\u0442\u0438\u0441\u044f +unsubscribe.text=\u042f\u043a\u0449\u043e\u0020\u0432\u0438\u0020\u0431\u0456\u043b\u044c\u0448\u0435\u0020\u043d\u0435\u0020\u0445\u043e\u0447\u0435\u0442\u0435\u0020\u043e\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u0442\u0438\u0020\u0440\u043e\u0437\u0441\u0438\u043b\u043a\u0443\u002c\u0020\u0432\u0438\u0020\u043c\u043e\u0436\u0435\u0442\u0435\u0020\u0432\u0456\u0434\u043f\u0438\u0441\u0430\u0442\u0438\u0441\u044f\u0020\u0432\u0456\u0434\u0020\u043d\u0435\u0457\u0020\u0443\u0020\u0441\u0432\u043e\u0454\u043c\u0443 +unsubscribe.profile=\u043f\u0440\u043e\u0444\u0456\u043b\u0456 read.more=\u0427\u0418\u0422\u0410\u0422\u0418 \u0414\u0410\u041b\u0406 \ No newline at end of file diff --git a/core/src/main/resources/templates/email/change-place-status-email-page.html b/core/src/main/resources/templates/email/change-place-status-email-page.html index f881e1fad..6f1453135 100644 --- a/core/src/main/resources/templates/email/change-place-status-email-page.html +++ b/core/src/main/resources/templates/email/change-place-status-email-page.html @@ -106,7 +106,7 @@ diff --git a/core/src/main/resources/templates/email/new-places-report-email-page.html b/core/src/main/resources/templates/email/new-places-report-email-page.html index 6accaa3d9..e82977eee 100644 --- a/core/src/main/resources/templates/email/new-places-report-email-page.html +++ b/core/src/main/resources/templates/email/new-places-report-email-page.html @@ -123,7 +123,7 @@ diff --git a/core/src/main/resources/templates/email/scheduled-notification-email-page.html b/core/src/main/resources/templates/email/scheduled-notification-email-page.html index e3c2eeafb..f2b9f5f42 100644 --- a/core/src/main/resources/templates/email/scheduled-notification-email-page.html +++ b/core/src/main/resources/templates/email/scheduled-notification-email-page.html @@ -120,7 +120,7 @@ diff --git a/service-api/src/main/java/greencity/constant/EmailConstants.java b/service-api/src/main/java/greencity/constant/EmailConstants.java index 60c0809ef..4ec2af15c 100644 --- a/service-api/src/main/java/greencity/constant/EmailConstants.java +++ b/service-api/src/main/java/greencity/constant/EmailConstants.java @@ -28,6 +28,7 @@ public class EmailConstants { public static final String RESULT = "result"; public static final String REPORT_TYPE = "reportType"; public static final String UNSUBSCRIBE_LINK = "unsubscribeLink"; + public static final String PROFILE_LINK = "profileLink"; public static final String ECO_NEWS_LIST = "ecoNewsList"; public static final String REASON = "reason"; public static final String DESCRIPTION = "description"; diff --git a/service/src/main/java/greencity/service/EmailServiceImpl.java b/service/src/main/java/greencity/service/EmailServiceImpl.java index 3d8988ad6..21e5ccf46 100644 --- a/service/src/main/java/greencity/service/EmailServiceImpl.java +++ b/service/src/main/java/greencity/service/EmailServiceImpl.java @@ -72,8 +72,7 @@ public void sendChangePlaceStatusEmail(ChangePlaceStatusDto changePlaceStatus) { model.put(EmailConstants.USER_NAME, changePlaceStatus.getAuthorFirstName()); model.put(EmailConstants.PLACE_NAME, changePlaceStatus.getPlaceName()); model.put(EmailConstants.STATUS, changePlaceStatus.getPlaceStatus().name()); - // TODO change later - model.put(EmailConstants.UNSUBSCRIBE_LINK, "https://example.com"); + model.put(EmailConstants.PROFILE_LINK, getProfileLink()); String template = createEmailTemplate(model, EmailConstants.CHANGE_PLACE_STATUS_EMAIL_PAGE); sendEmail(changePlaceStatus.getAuthorEmail(), messageSource.getMessage(EmailConstants.CHANGE_PLACE_STATUS, null, @@ -94,8 +93,7 @@ public void sendAddedNewPlacesReportEmail(SendReportEmailMessage message) { for (SubscriberDto user : message.getSubscribers()) { Map model = new HashMap<>(sharedModel); - // TODO change later - sharedModel.put(EmailConstants.UNSUBSCRIBE_LINK, "https://example.com"); + sharedModel.put(EmailConstants.PROFILE_LINK, getProfileLink()); model.put(EmailConstants.USER_NAME, user.getName()); model.put(EmailConstants.LANGUAGE, user.getLanguage()); String template = createEmailTemplate(model, EmailConstants.NEW_PLACES_REPORT_EMAIL_PAGE); @@ -296,8 +294,7 @@ public void sendScheduledNotificationEmail(ScheduledEmailMessage message) { model.put(EmailConstants.LANGUAGE, language); model.put(EmailConstants.TITLE, message.getSubject()); model.put(EmailConstants.BODY, message.getBody()); - // TODO change later - model.put(EmailConstants.UNSUBSCRIBE_LINK, "https://example.com"); + model.put(EmailConstants.PROFILE_LINK, getProfileLink()); String template = createEmailTemplate(model, EmailConstants.SCHEDULED_NOTIFICATION_PAGE); sendEmail(message.getEmail(), message.getSubject(), template); @@ -318,4 +315,8 @@ private Map buildModelMapForPasswordRestore(Long userId, String private String getClientLinkByIsUbs(boolean isUbs) { return clientLink + "/#" + (isUbs ? "/ubs" : "/greenCity"); } + + private String getProfileLink() { + return clientLink + "/#/profile"; + } }