generated from dxfeng/secondev-chapanda-feishu
51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
package com.engine.recruit.util;
|
||
|
||
import weaver.common.MessageUtil;
|
||
import weaver.email.EmailWorkRunnable;
|
||
import weaver.general.Util;
|
||
|
||
import java.util.Map;
|
||
|
||
/**
|
||
* @author:dxfeng
|
||
* @createTime: 2023/10/13
|
||
* @version: 1.0
|
||
*/
|
||
public class RecruitMessageUtils {
|
||
public static boolean SendEmail(Map<String, Object> param) {
|
||
String sendTo = Util.null2String(param.get("sendTo"));
|
||
String emailTitle = Util.null2String(param.get("emailTitle"));
|
||
String emailContent = Util.null2String(param.get("emailContent"));
|
||
return SendEmail(sendTo, emailTitle, emailContent);
|
||
}
|
||
|
||
public static boolean sendSMS(Map<String, Object> param) {
|
||
String receiver = Util.null2String(param.get("receiver"));
|
||
String content = Util.null2String(param.get("content"));
|
||
return sendSMS(receiver, content);
|
||
}
|
||
|
||
public static boolean SendEmail(String sendTo, String emailTitle, String emailContent) {
|
||
return MessageUtil.sendEmail(sendTo, emailTitle, emailContent);
|
||
}
|
||
|
||
/**
|
||
* @param sendTo 收件人
|
||
* @param emailTitle 邮件标题
|
||
* @param emailContent 邮件内容
|
||
* @param imageFileIds 邮件附件,imageFile表记录id,多个时英文逗号分隔
|
||
* @return
|
||
*/
|
||
public static boolean SendEmailWithFile(String sendTo, String emailTitle, String emailContent, String imageFileIds) {
|
||
EmailWorkRunnable emailWorkRunnable = new EmailWorkRunnable(sendTo, Util.toHtmlMode(emailTitle), Util.toHtmlMode(emailContent));
|
||
emailWorkRunnable.setImagefileids(imageFileIds);
|
||
return emailWorkRunnable.emailCommonRemind();
|
||
}
|
||
|
||
public static boolean sendSMS(String receiver, String content) {
|
||
return MessageUtil.sendSMS(receiver, content);
|
||
}
|
||
|
||
|
||
}
|