Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public reg: send status_id #639

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go-app-ussd_public_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ go.app = function() {
.send_whatsapp_template_message(msisdn, template_name)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status_id", data.status_id);
if (data.preferred_channel == "SMS") {
return self.rapidpro.get_global_flag("sms_registrations_enabled")
.then(function(sms_registration_enabled) {
Expand Down Expand Up @@ -528,7 +529,7 @@ go.app = function() {
mha: 6,
swt: self.im.user.get_answer("preferred_channel") === "SMS" ? "1" : "7",
preferred_channel: self.im.user.get_answer("preferred_channel"),

status_id: self.im.user.answers.status_id,
};

return self.rapidpro
Expand Down
3 changes: 2 additions & 1 deletion src/ussd_public_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ go.app = function() {
.send_whatsapp_template_message(msisdn, template_name)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status_id", data.status_id);
if (data.preferred_channel == "SMS") {
return self.rapidpro.get_global_flag("sms_registrations_enabled")
.then(function(sms_registration_enabled) {
Expand Down Expand Up @@ -309,7 +310,7 @@ go.app = function() {
mha: 6,
swt: self.im.user.get_answer("preferred_channel") === "SMS" ? "1" : "7",
preferred_channel: self.im.user.get_answer("preferred_channel"),

status_id: self.im.user.answers.status_id,
};

return self.rapidpro
Expand Down
14 changes: 10 additions & 4 deletions test/ussd_public_rapidpro.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ describe("ussd_public app", function() {
"+27123456789",
"test-welcome-template",
null,
"Whatsapp"
"Whatsapp",
"status-id-uuid"
)
);
api.http.fixtures.add(
Expand All @@ -505,7 +506,8 @@ describe("ussd_public app", function() {
"registered_by": "+27123456789",
"mha": 6,
"swt": "7",
"preferred_channel": "Whatsapp"
"preferred_channel": "Whatsapp",
"status_id": "status-id-uuid"
}
)
);
Expand Down Expand Up @@ -602,7 +604,8 @@ describe("ussd_public app", function() {
"+27123456789",
"test-welcome-template",
null,
"Whatsapp"
"Whatsapp",
"status-id-uuid"
)
);
api.http.fixtures.add(
Expand All @@ -618,7 +621,8 @@ describe("ussd_public app", function() {
"registered_by": "+27123456789",
"mha": 6,
"swt": "7",
"preferred_channel": "Whatsapp"
"preferred_channel": "Whatsapp",
"status_id": "status-id-uuid"
}
)
);
Expand Down Expand Up @@ -821,6 +825,7 @@ describe("ussd_public app", function() {
mha: 6,
swt: "1",
preferred_channel: "SMS",
status_id: "status-id-uuid"
}
)
);
Expand Down Expand Up @@ -870,6 +875,7 @@ describe("ussd_public app", function() {
mha: 6,
swt: "7",
preferred_channel: "Whatsapp",
status_id: "status-id-uuid"
}
)
);
Expand Down
Loading