private void generateReminderSentActivity(ClaimantReminder claimantReminder) {
   Activity activity = Activity.setActivityDefaults(new Activity());
   activity.setActivityCode(ActivityCode.CREATED);
   activity.setDescription("Claimant Reminder sent");
   activity.setActivityTypeDescription("Claimant Reminder");
   activity.setClaimant(claimantReminder.getClaimant());
   activity.persist();
 }
 public void validateRemindertoSendEmail(ClaimantReminder claimantReminder) {
   if (claimantReminder.getReminderStatus().toString().equals("Pending")
       && claimantReminder.getReminderType().getSendReminder()
       && (claimantReminder.getReminderDueDate().before(new Date())
           || !claimantReminder.getReminderDueDate().after(new Date()))
       && (isValidCheck || isClaimantReminder)) {
     String event = Event.getCurrentEventCode() != null ? Event.getCurrentEventCode() : "";
     String mailSubject =
         event + " - Reminder to " + claimantReminder.getReminderType().getDescription();
     sendReminder(
         claimantReminder.getClaimant().getPrimaryContact().getEmail(),
         getRemindermailcontent(
             isValidCheck,
             isClaimantReminder,
             claimantReminder.getReminderType().getDescription()),
         mailSubject);
     claimantReminder.setReminderStatus(ClaimantReminder.ReminderStatus.COMPLETE);
     generateReminderSentActivity(claimantReminder);
   }
 }