class EmailTemplateDaoImpl implements EmailTemplateDao {

  @Override
  public String getTemplate(String templateName) {

    List<String> idList = new ArrayList<>();
    if (StringUtils.isBlank(templateName)) {
      idList.add(DEFAULT_EMAIL_TEMPLATE_NAME);
    } else {
      idList.add(templateName);
    }
    Response response =
        getCassandraOperation().getRecordsByPrimaryKeys(
            JsonKey.SUNBIRD, EMAIL_TEMPLATE, idList, JsonKey.NAME);
    List<Map<String, Object>> emailTemplateList =
        (List<Map<String, Object>>) response.get(JsonKey.RESPONSE);
    Map<String, Object> map = Collections.emptyMap();
    if (CollectionUtils.isNotEmpty(emailTemplateList)) {
      map = emailTemplateList.get(0);
    }
    return (String) map.get(TEMPLATE);
  }

}