diff --git a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java index d570982..49e210f 100644 --- a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java +++ b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java @@ -180,6 +180,8 @@ public class PrintServiceImpl implements PrintService { private boolean isPasswordProtected; @Value("${mosip.send.uin.default-emailIds}") private String defaultEmailIds; + @Value("${mosip.idschema.attribute.email:email}") + private String emailAttribute; @Value("${mosip.print.service.mpesa.enabled:false}") private Boolean isMpesaEnabled; @Value("${mosip.print.service.mpesa.account.creation.url}") @@ -315,7 +317,9 @@ private Map getDocuments(String credential, String credentialTyp credentialSubject = getCrdentialSubject(credential); org.json.JSONObject credentialSubjectJson = new org.json.JSONObject(credentialSubject); org.json.JSONObject decryptedJson = decryptAttribute(credentialSubjectJson, encryptionPin, credential); - residentEmailId = decryptedJson.getString("email"); + if (decryptedJson.has(emailAttribute)) { + residentEmailId = decryptedJson.getString(emailAttribute); + } if (!StringUtils.hasText(registrationId)) { printLogger.info(decryptedJson.get("id").toString()); //registrationId = getRid(decryptedJson.get("id"));