|
@@ -240,23 +240,23 @@ func SendEmailFileToExpert(cont context.Context) (err error) {
|
|
} else if activityInfo.ChartPermissionName == "策略" || activityInfo.ChartPermissionNames == "研选" {
|
|
} else if activityInfo.ChartPermissionName == "策略" || activityInfo.ChartPermissionNames == "研选" {
|
|
touser = utils.EmailStrategy
|
|
touser = utils.EmailStrategy
|
|
}
|
|
}
|
|
- haveSuccess := utils.SendEmailHaveFile(title, content, fileName, touser)
|
|
|
|
- time.Sleep(time.Duration(2) * time.Second) //延迟两秒,避免过多活动的时候邮件发送没有内容
|
|
|
|
- defer func() {
|
|
|
|
- os.Remove(downLoadnFilePath)
|
|
|
|
- }()
|
|
|
|
- if haveSuccess {
|
|
|
|
|
|
+ //haveSuccess := utils.SendEmailHaveFile(title, content, fileName, touser)
|
|
|
|
+ sendResult := utils.SendEmailByHongze(title, content, touser, fileName, title+".xlsx")
|
|
|
|
+ //defer func() {
|
|
|
|
+ // os.Remove(downLoadnFilePath)
|
|
|
|
+ //}()
|
|
|
|
+ if sendResult {
|
|
errFile = models.UPdateActivityIdToSendFile(v.ActivityId)
|
|
errFile = models.UPdateActivityIdToSendFile(v.ActivityId)
|
|
if errFile != nil {
|
|
if errFile != nil {
|
|
msg = "获取失败,Err:" + errFile.Error()
|
|
msg = "获取失败,Err:" + errFile.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ os.Remove(downLoadnFilePath)
|
|
} else {
|
|
} else {
|
|
go utils.SendEmail("发送附件模版消息失败"+"【"+utils.APPNAME+"】"+time.Now().Format("2006-01-02 15:04:05"), msg+";Err:"+activityInfo.ActivityName, utils.EmailSendToUsers)
|
|
go utils.SendEmail("发送附件模版消息失败"+"【"+utils.APPNAME+"】"+time.Now().Format("2006-01-02 15:04:05"), msg+";Err:"+activityInfo.ActivityName, utils.EmailSendToUsers)
|
|
utils.FileLog.Info("发送附件模版消息失败,Err:%s", activityInfo.ActivityName)
|
|
utils.FileLog.Info("发送附件模版消息失败,Err:%s", activityInfo.ActivityName)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- fmt.Println("发送附件完成")
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|