Search in sources :

Example 16 with IPlugin

use of io.jpom.plugin.IPlugin in project Jpom by dromara.

the class EmailUtil method send.

/**
 * 发送邮箱
 *
 * @param email   收件人
 * @param title   标题
 * @param context 内容
 */
public static void send(String email, String title, String context) throws Exception {
    if (config == null) {
        // 没有数据才加载
        refreshConfig();
    }
    // 
    Map<String, Object> mailMap = new HashMap<>(10);
    mailMap.put("toEmail", email);
    mailMap.put("title", title);
    mailMap.put("context", context);
    // 
    IPlugin plugin = PluginFactory.getPlugin("email");
    plugin.execute(JSONObject.toJSON(config), mailMap);
}
Also used : HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) IPlugin(io.jpom.plugin.IPlugin)

Aggregations

IPlugin (io.jpom.plugin.IPlugin)16 JSONObject (com.alibaba.fastjson.JSONObject)10 DockerInfoModel (io.jpom.model.docker.DockerInfoModel)8 ClassFeature (io.jpom.permission.ClassFeature)5 Feature (io.jpom.permission.Feature)5 MethodFeature (io.jpom.permission.MethodFeature)5 HashMap (java.util.HashMap)5 File (java.io.File)4 JpomRuntimeException (io.jpom.system.JpomRuntimeException)2 CollUtil (cn.hutool.core.collection.CollUtil)1 BetweenFormatter (cn.hutool.core.date.BetweenFormatter)1 DateUtil (cn.hutool.core.date.DateUtil)1 SystemClock (cn.hutool.core.date.SystemClock)1 FileUtil (cn.hutool.core.io.FileUtil)1 IoUtil (cn.hutool.core.io.IoUtil)1 LineHandler (cn.hutool.core.io.LineHandler)1 ResourceUtil (cn.hutool.core.io.resource.ResourceUtil)1 CharPool (cn.hutool.core.text.CharPool)1 ArrayUtil (cn.hutool.core.util.ArrayUtil)1 StrUtil (cn.hutool.core.util.StrUtil)1