Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-queue-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3808dcb6
authored
Jan 02, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp1
parent
6d5c2e0d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
logs/orderSendPurchaseEmail.log
order/sendPurchaseEmail/sendEmail/sendEmail.go
logs/orderSendPurchaseEmail.log
View file @
3808dcb6
This diff is collapsed.
Click to expand it.
order/sendPurchaseEmail/sendEmail/sendEmail.go
View file @
3808dcb6
...
@@ -7,8 +7,14 @@ import (
...
@@ -7,8 +7,14 @@ import (
"net/http"
"net/http"
"encoding/json"
"encoding/json"
"strings"
"strings"
"io/ioutil"
)
)
type
JosnResp
struct
{
err_code
string
`json:"err_code"`
msg
string
`json:"msg"`
}
func
SendPurchaseEmail
(
data
string
)
(
err
error
)
{
func
SendPurchaseEmail
(
data
string
)
(
err
error
)
{
crm_url
:=
util
.
Configs
.
Crm_domain
.
SendMailUrl
// CRM发送邮件接口
crm_url
:=
util
.
Configs
.
Crm_domain
.
SendMailUrl
// CRM发送邮件接口
...
@@ -22,12 +28,25 @@ func SendPurchaseEmail(data string) (err error) {
...
@@ -22,12 +28,25 @@ func SendPurchaseEmail(data string) (err error) {
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
resp
,
err
:=
client
.
Do
(
req
)
resp
,
err
:=
client
.
Do
(
req
)
fmt
.
Println
(
resp
.
Body
)
defer
resp
.
Body
.
Close
()
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
fmt
.
Println
(
err
.
Error
())
}
}
body
,
_
:=
ioutil
.
ReadAll
(
resp
.
Body
)
fmt
.
Println
(
string
(
body
))
res
:=
&
JosnResp
{}
defer
resp
.
Body
.
Close
()
err1
:=
json
.
Unmarshal
(
body
,
res
)
if
err1
!=
nil
{
fmt
.
Println
(
err1
)
}
fmt
.
Println
(
res
)
return
return
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment