apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/emailbuilder/GrayPublishEmailBuilder.java/GrayPublishEmailBuilder/renderGrayReleaseRuleContent
class GrayPublishEmailBuilder:  private String renderGrayReleaseRuleContent(String bodyTemplate, ReleaseHistoryBO releaseHistory) {

    Map<String, Object> context = releaseHistory.getOperationContext();
    Object rules = context.get("rules");
    List<GrayReleaseRuleItemDTO>
            ruleItems = rules == null ?
            null : gson.fromJson(rules.toString(), GsonType.RULE_ITEMS);


    if (CollectionUtils.isEmpty(ruleItems)) {
      return bodyTemplate.replaceAll(EMAIL_CONTENT_GRAY_RULES_MODULE, "<br><h4>无灰度规则</h4>");
    }
    StringBuilder rulesHtmlBuilder = new StringBuilder();
    for (GrayReleaseRuleItemDTO ruleItem : ruleItems) {
      String clientAppId = ruleItem.getClientAppId();
      Set<String> ips = ruleItem.getClientIpList();

      rulesHtmlBuilder.append("<b>AppId:&nbsp;</b>")
              .append(clientAppId)
              .append("&nbsp;&nbsp; <b>IP:&nbsp;</b>");

      IP_JOINER.appendTo(rulesHtmlBuilder, ips);
    }
    String grayRulesModuleContent = portalConfig.emailGrayRulesModuleTemplate().replaceAll(EMAIL_CONTENT_GRAY_RULES_CONTENT,
            Matcher.quoteReplacement(rulesHtmlBuilder.toString()));

    return bodyTemplate.replaceAll(EMAIL_CONTENT_GRAY_RULES_MODULE, Matcher.quoteReplacement(grayRulesModuleContent));

  }