feat: send mail attachment

This commit is contained in:
zchengo
2023-01-30 15:50:10 +08:00
parent 3902d51d11
commit 4a424817de
4 changed files with 96 additions and 38 deletions
+10 -9
View File
@@ -54,16 +54,17 @@ func (c *CustomerService) SendMail(param *models.CustomerSendMailParam) int {
if mc.Status == Close {
return response.ErrCodeMailSendUnEnable
}
mailParam := models.MailParam{
Smtp: mc.Stmp,
Port: mc.Port,
AuthCode: mc.AuthCode,
Sender: mc.Email,
Subject: param.Subject,
Content: param.Content,
Receiver: param.Receiver,
mail := models.MailParam{
Smtp: mc.Stmp,
Port: mc.Port,
AuthCode: mc.AuthCode,
Sender: mc.Email,
Subject: param.Subject,
Content: param.Content,
Attachment: param.Attachment,
Receiver: param.Receiver,
}
if err := common.SendMailToCustomer(mailParam); err != nil {
if err := common.SendMailToCustomer(mail); err != nil {
return response.ErrCodeMailSendFailed
}
return response.ErrCodeSuccess