Sending int rather than string
This commit is contained in:
parent
df35140c0a
commit
dbd1a46349
@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Message structure for message data
|
// Message structure for message data
|
||||||
@ -61,10 +62,14 @@ func (s *Session) GetInbox() ([]Message, error) {
|
|||||||
|
|
||||||
// SendMessage will send a message via post
|
// SendMessage will send a message via post
|
||||||
func (s *Session) SendMessage(subject string, body string, recipientid string) error {
|
func (s *Session) SendMessage(subject string, body string, recipientid string) error {
|
||||||
|
reciever, err := strconv.Atoi(recipientid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
payload := map[string]interface{}{
|
payload := map[string]interface{}{
|
||||||
"subject": subject,
|
"subject": subject,
|
||||||
"body": body,
|
"body": body,
|
||||||
"recipientId": recipientid,
|
"recipientId": reciever,
|
||||||
}
|
}
|
||||||
data, err := json.Marshal(&payload)
|
data, err := json.Marshal(&payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user