Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Callback support/Delivery Receipt Processing #23

Open
lshep311 opened this issue Jan 7, 2020 · 3 comments
Open

Callback support/Delivery Receipt Processing #23

lshep311 opened this issue Jan 7, 2020 · 3 comments

Comments

@lshep311
Copy link

lshep311 commented Jan 7, 2020

The golang client we are currently using has implemented Delivery Receipts. In moving to this client implementation it appears that callbacks are on the TODO list. Is there a timeline for when this client will support processing delivery receipts? We have that on our roadmap. Additionally if this is already supported if there is an example then we can use that as well.

@lornajane
Copy link
Contributor

No timeline yet but I hear this request and will see what I can do!

@lornajane
Copy link
Contributor

I'm not sure when we'll be adding webhook support into the library but in case you or anyone else finds it helpful, here's a minimal example that doesn't rely on the library.

package main

import (
	"log"
	"net/http"
)

func handleDlrWebhook(w http.ResponseWriter, r *http.Request) {
	log.Println("Delivery status for message to " + r.FormValue("msisdn") + ": " + r.FormValue("status"))
}

func main() {
	log.Println("server started")
	http.HandleFunc("/webhook/dlr", handleDlrWebhook)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

This code starts a server on port 8080 - then you can use ngrok or a similar tool to make it available publicly (so that Nexmo's servers can send callbacks to it). If you then send an SMS with a parameter callback set to [your ngrok url]/webhook/dlr, this code will log the destination of the SMS message and its status.

Hope this helps to bridge the gap but rest assured that this issue will also stay open and we will work on this feature being in the library itself when we can.

@lornajane
Copy link
Contributor

Update to say that with a new library release, we have the models in place to support this. Next is to work up a code sample showing the delivery receipts being received using this library and sharing it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants