tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private void sendCreationEmail(SSLCertificateRequest sslCertificateRequest,
                                   UserDetails userDetails, String token) {
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String> builder()
                .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
                .put(LogMessage.ACTION, String.format("sendCreationEmail for SSL certificate [%s] - certType [%s] - "
                        , sslCertificateRequest.getCertificateName(), sslCertificateRequest.getCertType()))
                .build()));
        

         if (sslCertificateRequest.getCertType().equalsIgnoreCase(SSLCertificateConstants.INTERNAL)) {
            //Send email for certificate creation
            sendEmail(sslCertificateRequest.getCertType(), sslCertificateRequest.getCertificateName(),
                    sslCertificateRequest.getCertOwnerEmailId(),userDetails.getUsername(),
                    SSLCertificateConstants.CERT_CREATION_SUBJECT + " - " + sslCertificateRequest.getCertificateName(),
                    "created", token);
        } else {
             if(!isMockingEnabled(sslCertificateRequest.getCertType())) {
                 sendExternalEmail(sslCertificateRequest.getCertType(), sslCertificateRequest.getCertificateName(),
                         sslCertificateRequest.getCertOwnerEmailId(), userDetails.getUsername(),
                         SSLCertificateConstants.EX_CERT_CREATION_SUBJECT + " - " + sslCertificateRequest.getCertificateName(),
                         "creation");
             }
        }
    }
/**
     * THis method is responsible for sending email for cert creation for internal and external cert creation
     * @param sslCertificateRequest
     * @param userDetails
     * @param token
     */
THis method is responsible for sending email for cert creation for internal and external cert creation
@param sslCertificateRequest
@param userDetails
@param token
THis method is responsible for sending email for cert creation for internal and external cert creation @param sslCertificateRequest @param userDetails @param token
private void sendCreationEmail(SSLCertificateRequest sslCertificateRequest,
                                   UserDetails userDetails, String token) {
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String> builder()
                .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
                .put(LogMessage.ACTION, String.format("sendCreationEmail for SSL certificate [%s] - certType [%s] - "
                        , sslCertificateRequest.getCertificateName(), sslCertificateRequest.getCertType()))
                .build()));
         if (sslCertificateRequest.getCertType().equalsIgnoreCase(SSLCertificateConstants.INTERNAL)) {
            sendEmail(sslCertificateRequest.getCertType(), sslCertificateRequest.getCertificateName(),
                    sslCertificateRequest.getCertOwnerEmailId(),userDetails.getUsername(),
                    SSLCertificateConstants.CERT_CREATION_SUBJECT + " - " + sslCertificateRequest.getCertificateName(),
                    "created", token);
        } else {
             if(!isMockingEnabled(sslCertificateRequest.getCertType())) {
                 sendExternalEmail(sslCertificateRequest.getCertType(), sslCertificateRequest.getCertificateName(),
                         sslCertificateRequest.getCertOwnerEmailId(), userDetails.getUsername(),
                         SSLCertificateConstants.EX_CERT_CREATION_SUBJECT + " - " + sslCertificateRequest.getCertificateName(),
                         "creation");
             }
        }
    }
private void sendCreationEmail ( SSLCertificateRequest sslCertificateRequest , UserDetails userDetails , String token ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , String . format ( "sendCreationEmail for SSL certificate [%s] - certType [%s] - " , sslCertificateRequest . getCertificateName ( ) , sslCertificateRequest . getCertType ( ) ) ) . build ( ) ) ) ; if ( sslCertificateRequest . getCertType ( ) . equalsIgnoreCase ( SSLCertificateConstants . INTERNAL ) ) { sendEmail ( sslCertificateRequest . getCertType ( ) , sslCertificateRequest . getCertificateName ( ) , sslCertificateRequest . getCertOwnerEmailId ( ) , userDetails . getUsername ( ) , SSLCertificateConstants . CERT_CREATION_SUBJECT + " - " + sslCertificateRequest . getCertificateName ( ) , "created" , token ) ; } else { if ( ! isMockingEnabled ( sslCertificateRequest . getCertType ( ) ) ) { sendExternalEmail ( sslCertificateRequest . getCertType ( ) , sslCertificateRequest . getCertificateName ( ) , sslCertificateRequest . getCertOwnerEmailId ( ) , userDetails . getUsername ( ) , SSLCertificateConstants . EX_CERT_CREATION_SUBJECT + " - " + sslCertificateRequest . getCertificateName ( ) , "creation" ) ; } } }
THis method is responsible for sending email for cert creation for internal and external cert creation
 @param sslCertificateRequest
 @param userDetails
 @param token
THis method is responsible for sending email for cert creation for internal and external cert creation @param sslCertificateRequest @param userDetails @param token
//Send email for certificate creation