|
@@ -42,7 +42,7 @@ func (a *ExportReq) AllProjectExport() {
|
|
|
pathArr := export("customer_data_ttzl_project", tableColumn, exportKey, timeStr)
|
|
|
if len(pathArr) > 0 {
|
|
|
pathstr := compressFiles(pathArr, timeStr)
|
|
|
- state := sendMail(a.Mail, pathstr)
|
|
|
+ state := sendMail("项目", a.Mail, pathstr)
|
|
|
BiService.Insert("export_record", map[string]interface{}{
|
|
|
"positionId": a.PositionId,
|
|
|
"type": "project",
|
|
@@ -70,7 +70,7 @@ func (a *ExportReq) AllInfoExport() {
|
|
|
pathArr := export("customer_data_ttzl", tableColumn, exportKey, timeStr)
|
|
|
if len(pathArr) > 0 {
|
|
|
pathstr := compressFiles(pathArr, timeStr)
|
|
|
- state := sendMail(a.Mail, pathstr)
|
|
|
+ state := sendMail("资讯", a.Mail, pathstr)
|
|
|
BiService.Insert("export_record", map[string]interface{}{
|
|
|
"positionId": a.PositionId,
|
|
|
"type": "project",
|
|
@@ -157,12 +157,12 @@ func InirWrite(key []interface{}) (*excelize.StreamWriter, *excelize.File) {
|
|
|
}
|
|
|
|
|
|
// 发送邮箱
|
|
|
-func sendMail(target_mail string, path string) bool {
|
|
|
- mailStr := "<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>铁塔全量标讯数据导出</title>\n</head>\n<body>\n<div>\n <p>铁塔全量标讯数据已导出成功,请查收附件,导出时间:%s,请点击链接下载数据:<a href=\"%s\">%s</a></p>\n </div>\n</body>"
|
|
|
- html := fmt.Sprintf(mailStr, time.Now().Format(DateTime), path, path)
|
|
|
+func sendMail(title, target_mail string, path string) bool {
|
|
|
+ mailStr := "<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>铁塔全量%s数据导出</title>\n</head>\n<body>\n<div>\n <p>铁塔全量%s数据已导出成功,请查收附件,导出时间:%s,请点击链接下载数据:<a href=\"%s\">%s</a></p>\n </div>\n</body>"
|
|
|
+ html := fmt.Sprintf(mailStr, title, title, time.Now().Format(DateTime), path, path)
|
|
|
fool := false
|
|
|
for k, v := range GmailAuth {
|
|
|
- fool := mail.GSendMail("剑鱼标讯", target_mail, "", "", "铁塔全量标讯数据导出", html, "", "", v)
|
|
|
+ fool := mail.GSendMail("剑鱼标讯", target_mail, "", "", fmt.Sprintf("铁塔全量%s数据导出", title), html, "", "", v)
|
|
|
if fool {
|
|
|
log.Println(target_mail, fmt.Sprintf("使用%s发送邮件成功", v.User))
|
|
|
break
|