139 lines
5.0 KiB
Java
139 lines
5.0 KiB
Java
|
|
package com.ai.da.service;
|
|||
|
|
|
|||
|
|
import com.ai.da.mapper.primary.entity.Account;
|
|||
|
|
import com.ai.da.mapper.primary.entity.TrialOrder;
|
|||
|
|
import com.ai.da.model.dto.AffiliateEmailParamsDTO;
|
|||
|
|
import com.ai.da.model.dto.BasicEmailParamDTO;
|
|||
|
|
import com.ai.da.model.dto.SubscriptionEmailParamsDTO;
|
|||
|
|
import com.alibaba.fastjson.JSONObject;
|
|||
|
|
import org.springframework.core.io.InputStreamSource;
|
|||
|
|
|
|||
|
|
import java.util.List;
|
|||
|
|
|
|||
|
|
public interface EmailService {
|
|||
|
|
|
|||
|
|
|
|||
|
|
void loadSingleEmailTemplate(String templatePath);
|
|||
|
|
|
|||
|
|
void loadTemplatesFromResources(String resourcesPath);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发邮件
|
|||
|
|
*
|
|||
|
|
* @param mailTo 收件人邮箱
|
|||
|
|
* @param jsonObject 动态邮件模板参数
|
|||
|
|
* @param templateName 邮件模板名(只有文件名且需要带文件后缀)
|
|||
|
|
* @param title 邮件标题
|
|||
|
|
* @param fileName 附件文件名。没有附件置为null
|
|||
|
|
* @param inputStreamSource 附件文件数据。没有附件置为null
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
void sendEmail(List<String> mailTo, JSONObject jsonObject, String templateName, String title, String fileName, InputStreamSource inputStreamSource);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 适用于 : 需要自定义发件人信息
|
|||
|
|
*
|
|||
|
|
* @param jsonObject 模板参数
|
|||
|
|
* @param basicEmailParamDTO 包含发件人信息、邮件标题、收件人信息
|
|||
|
|
* @param templateName 使用的模板文件名
|
|||
|
|
* @param fileName 附件文件名
|
|||
|
|
* @param inputStreamSource 附件文件信息
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
void sendEmail(JSONObject jsonObject, BasicEmailParamDTO basicEmailParamDTO, String templateName, String fileName, InputStreamSource inputStreamSource);
|
|||
|
|
|
|||
|
|
// 登入模板id
|
|||
|
|
String LOGIN_TEMPLATE_ID = "58020_login_aida_en.html";
|
|||
|
|
// 修改密码模板id
|
|||
|
|
String UPDATE_PWD_TEMPLATE_ID = "58022_update_password.html";
|
|||
|
|
// 异常ip模板id
|
|||
|
|
String EXCEPTION_ID_TEMPLATE_ID = "58021_exception_ip.html";
|
|||
|
|
// 绑定邮箱模板id
|
|||
|
|
String BIND_MAILBOX_TEMPLATE_ID = "132754_绑定邮箱.html";
|
|||
|
|
// 更换绑定邮箱
|
|||
|
|
String CHANGE_MAILBOX_TEMPLATE_ID = "128210_change_mailbox_en.html";
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送登录相关的邮件
|
|||
|
|
*
|
|||
|
|
* @param receiverAddress 收件地址
|
|||
|
|
* @param ip 请求ip
|
|||
|
|
* @param templateId 模板ID名
|
|||
|
|
* @param verifyCode 验证码
|
|||
|
|
*/
|
|||
|
|
Boolean send(String receiverAddress, String ip, String templateId, String verifyCode);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送试用订单相关的邮件
|
|||
|
|
*
|
|||
|
|
* @param receiverAddress 收件人邮箱地址
|
|||
|
|
* @param trialOrder 试用订单相关参数
|
|||
|
|
* @param emailType 邮件类型:1 - 提交试用请求,2 - 审批通过,3 - 试用请求通过通知
|
|||
|
|
* @param country 通过城市判断邮件模板的语言
|
|||
|
|
* @param link ?
|
|||
|
|
*/
|
|||
|
|
void sendCustomEmail(String receiverAddress, TrialOrder trialOrder, int emailType, String country, Boolean link);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送昨日的试用订单用户数据
|
|||
|
|
*
|
|||
|
|
* @param receiverAddress 收件人地址
|
|||
|
|
* @param fileName 附件文件名
|
|||
|
|
* @param inputStreamSource 附件文件数据
|
|||
|
|
*/
|
|||
|
|
void sendExcelEmail(List<String> receiverAddress, String fileName, InputStreamSource inputStreamSource);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送昨日的试用订单用户数据--无试用订单情况
|
|||
|
|
*
|
|||
|
|
* @param receiverAddress 收件人地址
|
|||
|
|
*/
|
|||
|
|
void sendNoExcelEmail(List<String> receiverAddress);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 向账号快要到期的用户发送提醒邮件
|
|||
|
|
*
|
|||
|
|
* @param account 账号信息
|
|||
|
|
*/
|
|||
|
|
void sendWillBeExpiredEmail(Account account);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送系统升级通知邮件
|
|||
|
|
*
|
|||
|
|
* @param account 用户信息
|
|||
|
|
* @param senderAddress 发件人邮件
|
|||
|
|
* @param type 邮件类型
|
|||
|
|
*/
|
|||
|
|
void sendUpgradeNotification(Account account, String senderAddress, Integer type);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 通知在Code_Create上付费的用户,AiDA账号的更新
|
|||
|
|
*
|
|||
|
|
* @param receiverAddress 收件人地址
|
|||
|
|
* @param emailType 邮件类型
|
|||
|
|
* @param country 国家(确定发送邮件的语言)
|
|||
|
|
* @param userName 用户名
|
|||
|
|
* @param date 账号到期时间
|
|||
|
|
*/
|
|||
|
|
void notificationForPaidUser(String receiverAddress, int emailType, String country, String userName, String date);
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 广场用户注册通知邮件
|
|||
|
|
*
|
|||
|
|
* @param userEmail
|
|||
|
|
* @param randomVerifyCode
|
|||
|
|
* @return
|
|||
|
|
*/
|
|||
|
|
Boolean designWorksRegister(String userEmail, String randomVerifyCode);
|
|||
|
|
|
|||
|
|
void uploadTimeoutReminder(String userName, String time);
|
|||
|
|
|
|||
|
|
boolean subscriptionEmailReminder(String type, SubscriptionEmailParamsDTO subscriptionEmailParamsDTO, String language, String receiverAddress);
|
|||
|
|
|
|||
|
|
void affiliateEmailReminder(List<String> receiverAddress, AffiliateEmailParamsDTO paramsDTO, String type);
|
|||
|
|
|
|||
|
|
void creditsPurchaseReminder(String username, String quantity, String amount);
|
|||
|
|
|
|||
|
|
void commonExceptionReminder(String functionName, List<String> destination);
|
|||
|
|
}
|