class DtpEmailNotifier extends AbstractDtpNotifier {

    public DtpEmailNotifier() {
        super(ApplicationContextHolder.getBean(EmailNotifier.class));
    }

    @Override
    public String platform() {
        return NotifyPlatformEnum.EMAIL.name().toLowerCase();
    }

    @Override
    protected String getNoticeTemplate() {
        return null;
    }

    @Override
    protected String getAlarmTemplate() {
        return null;
    }

    @Override
    protected Pair<String, String> getColors() {
        return null;
    }

    @Override
    protected String buildAlarmContent(NotifyPlatform platform, NotifyItemEnum notifyItemEnum) {
        AlarmCtx alarmCtx = (AlarmCtx) DtpNotifyCtxHolder.get();
        ExecutorWrapper executorWrapper = alarmCtx.getExecutorWrapper();
        val executor = executorWrapper.getExecutor();
        NotifyItem notifyItem = alarmCtx.getNotifyItem();
        AlarmInfo alarmInfo = alarmCtx.getAlarmInfo();
        val statProvider = executorWrapper.getThreadPoolStatProvider();
        val alarmValue = notifyItem.getThreshold() + notifyItemEnum.getUnit() + " / "
                + AlarmCounter.calcCurrentValue(executorWrapper, notifyItemEnum) + notifyItemEnum.getUnit();

        Context context = newContext(executorWrapper);
        context.setVariable("alarmType", populateAlarmItem(notifyItemEnum, executorWrapper));
        context.setVariable("alarmValue", alarmValue);
        context.setVariable("corePoolSize", executor.getCorePoolSize());
        context.setVariable("maximumPoolSize", executor.getMaximumPoolSize());
        context.setVariable("poolSize", executor.getPoolSize());
        context.setVariable("activeCount", executor.getActiveCount());
        context.setVariable("largestPoolSize", executor.getLargestPoolSize());
        context.setVariable("taskCount", executor.getTaskCount());
        context.setVariable("completedTaskCount", executor.getCompletedTaskCount());
        context.setVariable("waitingTaskCount", executor.getQueueSize());
        context.setVariable("queueType", executor.getQueueType());
        context.setVariable("queueCapacity", executor.getQueueCapacity());
        context.setVariable("queueSize", executor.getQueueSize());
        context.setVariable("queueRemaining", executor.getQueueRemainingCapacity());
        context.setVariable("rejectType", executor.getRejectHandlerType());
        context.setVariable("rejectCount", statProvider.getRejectedTaskCount());
        context.setVariable("runTimeoutCount", statProvider.getRunTimeoutCount());
        context.setVariable("queueTimeoutCount", statProvider.getQueueTimeoutCount());
        context.setVariable("lastAlarmTime", alarmInfo.getLastAlarmTime() == null ? UNKNOWN : alarmInfo.getLastAlarmTime());
        context.setVariable("alarmTime", DateUtil.now());
        context.setVariable("trace", getTraceInfo());
        context.setVariable("alarmInterval", notifyItem.getInterval());
        context.setVariable("highlightVariables", getAlarmKeys(notifyItemEnum));
        context.setVariable("ext", getExtInfo());
        return ((EmailNotifier) notifier).processTemplateContent("alarm", context);
    }

    @Override
    protected String buildNoticeContent(NotifyPlatform platform, TpMainFields oldFields, List<String> diffs) {<FILL_FUNCTION_BODY>}

    private Context newContext(ExecutorWrapper executorWrapper) {
        Context context = new Context();
        context.setVariable("serviceName", CommonUtil.getInstance().getServiceName());
        context.setVariable("serviceAddress", CommonUtil.getInstance().getIp() + ":" + CommonUtil.getInstance().getPort());
        context.setVariable("serviceEnv", CommonUtil.getInstance().getEnv());
        context.setVariable("poolName", populatePoolName(executorWrapper));
        return context;
    }
}

        BaseNotifyCtx notifyCtx = DtpNotifyCtxHolder.get();
        ExecutorWrapper executorWrapper = notifyCtx.getExecutorWrapper();
        val executor = executorWrapper.getExecutor();

        Context context = newContext(executorWrapper);
        context.setVariable("oldCorePoolSize", oldFields.getCorePoolSize());
        context.setVariable("newCorePoolSize", executor.getCorePoolSize());
        context.setVariable("oldMaxPoolSize", oldFields.getMaxPoolSize());
        context.setVariable("newMaxPoolSize", executor.getMaximumPoolSize());
        context.setVariable("oldIsAllowCoreThreadTimeOut", oldFields.isAllowCoreThreadTimeOut());
        context.setVariable("newIsAllowCoreThreadTimeOut", executor.allowsCoreThreadTimeOut());
        context.setVariable("oldKeepAliveTime", oldFields.getKeepAliveTime());
        context.setVariable("newKeepAliveTime", executor.getKeepAliveTime(TimeUnit.SECONDS));
        context.setVariable("queueType", executor.getQueueType());
        context.setVariable("oldQueueCapacity", oldFields.getQueueCapacity());
        context.setVariable("newQueueCapacity", executor.getQueueCapacity());
        context.setVariable("oldRejectType", oldFields.getRejectType());
        context.setVariable("newRejectType", executor.getRejectHandlerType());
        context.setVariable("notifyTime", DateUtil.now());
        context.setVariable("diffs", diffs != null ? diffs : Collections.emptySet());
        return ((EmailNotifier) notifier).processTemplateContent("notice", context);
    
<methods>public void sendAlarmMsg(org.dromara.dynamictp.common.entity.NotifyPlatform, org.dromara.dynamictp.common.em.NotifyItemEnum) ,public void sendChangeMsg(org.dromara.dynamictp.common.entity.NotifyPlatform, org.dromara.dynamictp.common.entity.TpMainFields, List<java.lang.String>) <variables>protected org.dromara.dynamictp.common.notifier.Notifier notifier