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