Unverified Commit 4fbd9380 authored by 乔占卫's avatar 乔占卫 Committed by GitHub
Browse files

Update MailUtils.java

if there is no receivers && no receiversCc, no need to process
parent 2714cb1e
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -102,16 +102,15 @@ 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<>();

        receivers.removeIf((from) -> (StringUtils.isEmpty(from)));
        retMap.put(Constants.STATUS, false);
        
        // if there is no receivers && no receiversCc, no need to process
        if (CollectionUtils.isEmpty(receivers) && CollectionUtils.isEmpty(receiversCc)) {
            retMap.put(Constants.STATUS, true);
            return retMap;
        }

        retMap.put(Constants.STATUS, false);
        receivers.removeIf((from) -> (StringUtils.isEmpty(from)));
        
        if (showType == ShowType.TABLE || showType == ShowType.TEXT){
            // send email
            HtmlEmail email = new HtmlEmail();