Ejemplo n.º 1
0
  private void sendAlertToJuryElement(
      PhdIndividualProgramProcess process,
      ThesisJuryElement thesisJuryElement,
      String bodyMessage) {
    PhdParticipant participant = thesisJuryElement.getParticipant();

    if (!participant.isInternal()) {
      createExternalAccess(thesisJuryElement);
      participant.ensureExternalAccess();
    }
    final AlertMessage subject =
        AlertMessage.create(
                AlertMessage.get(
                    "message.phd.request.jury.reviews.external.access.subject",
                    process.getPhdProgram().getName()))
            .isKey(false)
            .withPrefix(false);

    final AlertMessage body =
        AlertMessage.create(
                AlertMessage.get(
                        bodyMessage, process.getPerson().getName(), process.getProcessNumber())
                    + "\n\n"
                    + getAccessInformation(
                        process,
                        participant,
                        "message.phd.request.jury.reviews.coordinator.access",
                        "message.phd.request.jury.reviews.teacher.access")
                    + "\n\n"
                    + AlertMessage.get(
                        "message.phd.request.jury.external.access.reviews.body",
                        getDaysLeftForReview(process.getThesisProcess())))
            .isKey(false)
            .withPrefix(false);

    AlertService.alertParticipants(process, subject, body, participant);
  }