Skip to content

Commit

Permalink
Commit with change in sendEmailNotification method
Browse files Browse the repository at this point in the history
  • Loading branch information
Lena Sotnik authored and Lena Sotnik committed Sep 22, 2023
1 parent 3ad139b commit 4078ea4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions service/src/main/java/greencity/service/EventServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public EventDto save(AddEventDtoRequest addEventDtoRequest, String email,
}.getType()));

Event savedEvent = eventRepo.save(toSave);
sendEmailNotification(savedEvent, organizer);
sendEmailNotification(savedEvent.getTitle(), organizer.getFirstName(), organizer.getEmail());
return buildEventDto(savedEvent, organizer.getId());
}

Expand Down Expand Up @@ -787,11 +787,11 @@ private EventDto buildEventDto(Event event) {
*
* @author Olena Sotnik.
*/
public void sendEmailNotification(Event event, User user) {
String message = "Dear, " + user.getFirstName() + "!"
+ "\nYou have successfully created an event: " + event.getTitle();
public void sendEmailNotification(String eventTitle, String userName, String email) {
String message = "Dear, " + userName + "!"
+ "\nYou have successfully created an event: " + eventTitle;
SendEventCreationNotification notification = SendEventCreationNotification.builder()
.email(user.getEmail())
.email(email)
.messageBody(message)
.build();
restClient.sendEventCreationNotification(notification);
Expand Down

0 comments on commit 4078ea4

Please sign in to comment.