feat: mail config and mail send
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"crm/models"
|
||||
"crm/response"
|
||||
"crm/service"
|
||||
"log"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -45,6 +46,21 @@ func (c *CustomerApi) Update(context *gin.Context) {
|
||||
response.Result(errCode, nil, context)
|
||||
}
|
||||
|
||||
// 发送邮件给客户
|
||||
func (c *CustomerApi) SendMail(context *gin.Context) {
|
||||
var param models.CustomerSendMailParam
|
||||
uid, _ := strconv.Atoi(context.Request.Header.Get("uid"))
|
||||
err := context.ShouldBind(¶m)
|
||||
if uid <= 0 || err != nil {
|
||||
response.Result(response.ErrCodeParamInvalid, nil, context)
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
param.Uid = int64(uid)
|
||||
errCode := c.customerService.SendMail(¶m)
|
||||
response.Result(errCode, nil, context)
|
||||
}
|
||||
|
||||
// 删除客户
|
||||
func (c *CustomerApi) Delete(context *gin.Context) {
|
||||
var param models.CustomerDeleteParam
|
||||
|
||||
Reference in New Issue
Block a user