Skip to content

Commit 3b29da4

Browse files
committed
Update payloads for tasks queued to mailroom
1 parent 220fcd3 commit 3b29da4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: backends/rapidpro/task.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import (
1212
func queueMsgHandling(rc redis.Conn, c *Contact, m *Msg) error {
1313
channel := m.Channel().(*Channel)
1414

15-
// queue to mailroom
1615
body := map[string]any{
17-
"contact_id": c.ID_,
18-
"org_id": channel.OrgID_,
1916
"channel_id": channel.ID_,
2017
"msg_id": m.ID_,
2118
"msg_uuid": m.UUID(),
@@ -32,10 +29,11 @@ func queueMsgHandling(rc redis.Conn, c *Contact, m *Msg) error {
3229

3330
func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error {
3431
body := map[string]any{
35-
"org_id": e.OrgID_,
36-
"contact_id": e.ContactID_,
32+
"event_id": e.ID_,
33+
"event_type": e.EventType_,
3734
"urn_id": e.ContactURNID_,
3835
"channel_id": e.ChannelID_,
36+
"optin_id": e.OptInID_,
3937
"extra": e.Extra(),
4038
"new_contact": c.IsNew_,
4139
"occurred_on": e.OccurredOn_,
@@ -61,7 +59,7 @@ func queueChannelEvent(rc redis.Conn, c *Contact, e *ChannelEvent) error {
6159
}
6260

6361
func queueMsgDeleted(rc redis.Conn, ch *Channel, msgID courier.MsgID, contactID ContactID) error {
64-
return queueMailroomTask(rc, "msg_deleted", ch.OrgID_, contactID, map[string]any{"org_id": ch.OrgID_, "msg_id": msgID})
62+
return queueMailroomTask(rc, "msg_deleted", ch.OrgID_, contactID, map[string]any{"msg_id": msgID})
6563
}
6664

6765
// queueMailroomTask queues the passed in task to mailroom. Mailroom processes both messages and

0 commit comments

Comments
 (0)