Merge pull request #35 from Baoqi/dev_dont_send_email_when_no_recipts
before send mail, check whether no receivers && cc receivers
This commit is contained in:
commit
e42d2aa558
|
|
@ -103,10 +103,14 @@ public class MailUtils {
|
|||
public static Map<String,Object> sendMails(Collection<String> receivers, Collection<String> receiversCc, String title, String content, ShowType showType) {
|
||||
Map<String,Object> retMap = new HashMap<>();
|
||||
retMap.put(Constants.STATUS, false);
|
||||
|
||||
|
||||
// if there is no receivers && no receiversCc, no need to process
|
||||
if (CollectionUtils.isEmpty(receivers) && CollectionUtils.isEmpty(receiversCc)) {
|
||||
return retMap;
|
||||
}
|
||||
|
||||
receivers.removeIf((from) -> (StringUtils.isEmpty(from)));
|
||||
|
||||
|
||||
if (showType == ShowType.TABLE || showType == ShowType.TEXT){
|
||||
// send email
|
||||
HtmlEmail email = new HtmlEmail();
|
||||
|
|
|
|||
Loading…
Reference in New Issue