Skip to content

Commit

Permalink
Added additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KianKwa committed May 3, 2024
1 parent ee64092 commit cf36cb1
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ public String handleMiDataForReporting() {
return emailService.sendEmail(email).getReference().orElse(null);
}

/**
* This method handles the sending the email to all system admins for some actions on the application.
*
* @param body The body of the system admin update email.
* @return The ID that references the system admin update email.
*/
public List<String> sendSystemAdminUpdateEmailRequest(SystemAdminAction body) {
List<EmailToSend> email = emailService.handleBatchEmailGeneration(new SystemAdminUpdateEmailData(body, envName),
Templates.SYSTEM_ADMIN_UPDATE_EMAIL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String mediaAccountWelcomeEmailRequest(WelcomeEmail body) {
* Handles the incoming request for AAD welcome emails, checks the json payload and builds and sends the email.
*
* @param body JSONObject containing the email and forename/surname values e.g.
* email: '[email protected]', forename: 'foo', surname: 'bar'}
* {email: '[email protected]', forename: 'foo', surname: 'bar'}
*/
public String adminAccountWelcomeEmailRequest(CreatedAdminWelcomeEmail body) {
log.info(writeLog(String.format("Admin account welcome email being processed for user %s",
Expand Down Expand Up @@ -135,6 +135,12 @@ public String inactiveUserNotificationEmailRequest(InactiveUserNotificationEmail
.orElse(null);
}

/**
* Handles the sending of the email containing the OTP.
*
* @param body The body of the OTP email.
* @return The ID that references the OTP email.
*/
public String handleOtpEmailRequest(OtpEmail body) {
log.info(writeLog(String.format("OTP email being processed for user %s",
EmailHelper.maskEmail(body.getEmail()))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.ADMIN_ACCOUNT_CREATION_EMAIL;

@Service
/**
* Generate the admin welcome email with personalisation for GOV.UK Notify template.
*/
public class AdminWelcomeEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
@Service
@Slf4j
@SuppressWarnings("PMD.PreserveStackTrace")
/**
* Generate the flat file subscription email with personalisation for GOV.UK Notify template.
*/
public class FlatFileSubscriptionEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.INACTIVE_USER_NOTIFICATION_EMAIL_CFT;

@Service
/**
* Generate the inactive user notification email with personalisation for GOV.UK Notify template.
*/
public class InactiveUserNotificationEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.DELETE_LOCATION_SUBSCRIPTION;

@Service
/**
* Generate the location subscription email with personalisation for GOV.UK Notify template.
*/
public class LocationSubscriptionDeletionEmailGenerator extends BatchEmailGenerator {
@Override
public List<EmailToSend> buildEmail(BatchEmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_USER_REJECTION_EMAIL;

@Service
/**
* Generate the media account rejection email with personalisation for GOV.UK Notify template.
*/
public class MediaAccountRejectionEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
@Service
@Slf4j
@SuppressWarnings("PMD.PreserveStackTrace")
/**
* Generate the media application reporting email with personalisation for GOV.UK Notify template.
*/
public class MediaApplicationReportingEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_DUPLICATE_ACCOUNT_EMAIL;

@Service
/**
* Generate the media duplicated account email with personalisation for GOV.UK Notify template.
*/
public class MediaDuplicatedAccountEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_USER_VERIFICATION_EMAIL;

@Service
/**
* Generate the media user verification email with personalisation for GOV.UK Notify template.
*/
public class MediaUserVerificationEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_NEW_ACCOUNT_SETUP;

@Service
/**
* Generate the media welcome email with personalisation for GOV.UK Notify template.
*/
public class MediaWelcomeEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
@Service
@Slf4j
@SuppressWarnings("PMD.PreserveStackTrace")
/**
* Generate the MI data reporting email with personalisation for GOV.UK Notify template.
*/
public class MiDataReportingEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.OTP_EMAIL;

@Service
/**
* Generate the OTP email with personalisation for GOV.UK Notify template.
*/
public class OtpEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
@Service
@Slf4j
@SuppressWarnings("PMD.PreserveStackTrace")
/**
* Generate the raw data subscription email with personalisation for GOV.UK Notify template.
*/
public class RawDataSubscriptionEmailGenerator extends EmailGenerator {
private static final String CASE_NUMBERS = "case_num";
private static final String DISPLAY_CASE_NUMBERS = "display_case_num";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.SYSTEM_ADMIN_UPDATE_EMAIL;

@Service
/**
* Generate the system admin update email with personalisation for GOV.UK Notify template.
*/
public class SystemAdminUpdateEmailGenerator extends BatchEmailGenerator {
@Override
public List<EmailToSend> buildEmail(BatchEmailData email, PersonalisationLinks personalisationLinks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.BAD_BLOB_EMAIL;

@Service
/**
* Generate the unidentified blob email with personalisation for GOV.UK Notify template.
*/
public class UnidentifiedBlobEmailGenerator extends EmailGenerator {
@Override
public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {
Expand Down

0 comments on commit cf36cb1

Please sign in to comment.