@Override public EmailMessage createDigest(String orcid, Collection<Notification> notifications) { OrcidProfile orcidProfile = orcidProfileManager.retrieveOrcidProfile(orcid, LoadOptions.BIO_AND_INTERNAL_ONLY); Locale locale = localeManager.getLocaleFromOrcidProfile(orcidProfile); return createDigest(orcidProfile, notifications, locale); }
@Override public void sendAmendEmail(String orcid, AmendedSection amendedSection, Item item) { OrcidProfile amendedProfile = orcidProfileManager.retrieveOrcidProfile(orcid, LoadOptions.BIO_AND_INTERNAL_ONLY); Collection<Item> items = new ArrayList<Item>(1); items.add(item); sendAmendEmail(amendedProfile, amendedSection, items); }
/** * Creates a minimal record * * @param orcidProfile The record to create * @return the new record */ private OrcidProfile createMinimalProfile(OrcidProfile orcidProfile, boolean usedCaptcha) { OrcidProfile minimalProfile = orcidProfileManager.createOrcidProfile(orcidProfile, false, usedCaptcha); // Set source to the new email String sourceId = minimalProfile.getOrcidIdentifier().getPath(); List<Email> emails = minimalProfile.getOrcidBio().getContactDetails().getEmail(); for (Email email : emails) emailManager.addSourceToEmail(email.getValue(), sourceId); LOGGER.debug( "Created minimal orcid and assigned id of {}", orcidProfile.getOrcidIdentifier().getPath()); return minimalProfile; }