Skip to content

Commit

Permalink
remove email sender after creating upsertEnrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavofg1pontes committed Oct 8, 2024
1 parent 31da3b8 commit 34eeaef
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,11 @@ public String execute(CreateUpsertEnrollmentInput anIn) {
final UpsertEnrollment enrollment = UpsertEnrollment
.newUpsertEnrollment(name, emailString, document, birthDate, userID, eventID, ticketSaleID, ticketID);

final Message message = this.messageGateway.findBySubjectAndType(MessageSubject.PAYMENT_EMAIL, MessageType.HTML).orElseThrow(() -> NotFoundException.with("Email template not found"));
final Notification notification = Notification.create();
enrollment.validate(notification);
notification.throwPossibleErrors();
final UpsertEnrollment createdEnrollment = this.upsertEnrollmentGateway.create(enrollment);

final Email email = Email.createDynamic(emailString, message, name, company.getName(), preference);
email.validate(notification);
notification.throwPossibleErrors();
final Email createdEmail = this.emailGateway.create(email);

return createdEnrollment.getId().getValue().toString();
}
}

0 comments on commit 34eeaef

Please sign in to comment.