Back

[CLOSED] msg91 does not work for otp

  • 0
  • Self Hosted
  • Accounts
  • Web
Abhishek
20 Oct, 2023, 20:48

Yes! Using template id in flow id

TL;DR
Title: [CLOSED] Msg91 OTP not working Solution: By implementing the provided workaround, the issue was resolved. The workaround involved making changes to the Msg91.php file and restarting the appwrite-worker-messaging container. Additional Request: The user suggested implementing the send otp API instead of flow/campaign for higher priority OTP messages. The team was requested to discuss this suggestion. Logs and Screenshot: The user was asked to provide logs and a screenshot of the appwrite-worker-messaging container. Follow-up: The user reported that changing "recipients" to "mobiles" worked for them. They were asked to share the
Abhishek
20 Oct, 2023, 20:48

In template, we just configure the text template with variable and sender id

Drake
20 Oct, 2023, 20:52

What exactly did you configure? Please share a screenshot

Abhishek
20 Oct, 2023, 20:54
Abhishek
20 Oct, 2023, 20:55

SMS content, variables, Sender ID

Drake
20 Oct, 2023, 20:59

Thanks let me check

Abhishek
20 Oct, 2023, 20:59

Thank you!

Drake
20 Oct, 2023, 22:12

is this set as the default template?

Abhishek
20 Oct, 2023, 22:13

Yes!

Drake
21 Oct, 2023, 00:03

And you still get the same error? Please share the new details

Abhishek
21 Oct, 2023, 00:03

Yes! Same error

Abhishek
21 Oct, 2023, 00:04

When I change the “recipients” to “mobiles” it works. Please the postman api call in the above screenshot

Drake
21 Oct, 2023, 00:11

please share a screenshot. as well as the logs from the appwrite-worker-messaging container

Abhishek
21 Oct, 2023, 00:13
TypeScript
[notice] Starting worker cc64ffd05239:7:v1-messaging
[notice] Starting work on (Job{v1-messaging} | ID: 87fd6622bada1074361831fcaafb6bc9 | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"325347","events":["."]}])
[notice] (Job{v1-messaging} | ID: 87fd6622bada1074361831fcaafb6bc9 | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"325347","events":["."]}]) has finished
Abhishek
21 Oct, 2023, 00:18
Drake
21 Oct, 2023, 00:40

thanks. let me get this to the team. they're offline by now, though, so they won't be able to get to this until monday

Drake
21 Oct, 2023, 00:49

although maybe you can try this:

TypeScript
docker compose exec appwrite-worker-messaging sed -i 's#\[$to\]#$to#g' /usr/src/code/vendor/utopia-php/messaging/src/Utopia/Messaging/Adapters/SMS/Msg91.php
docker compose restart appwrite-worker-messaging
gaurav_ch
21 Oct, 2023, 03:22

@Steven if possible can you discuss with the team to implement the send otp api (https://docs.msg91.com/reference/sendotp) instead of flow? send otp is specifically for authentication whereas flow/campaign is for transactional sms. The OTP sms has higher priority than transactional sms.

Drake
21 Oct, 2023, 03:27

No. Because our messaging is designed to send any sms message, not just otp

Abhishek
21 Oct, 2023, 18:47

This workaround works! Thank you so much @Steven. Much appreciate your support 👏🏻

gaurav_ch
22 Oct, 2023, 03:53

What solution did you implement finally?

Abhishek
23 Oct, 2023, 05:40

We are using SMS service from Msg91.

  1. Get Approval from DLT provider - Header/Sender ID and Template ID.
  2. Set Sender ID in Msg91 > SMS
  3. Set Template in Msg91 > SMS. Here the variable should be otp
  4. Set Auth Key in Msg91 > Setting > Auth key.
  5. Set env in Appwrite. Sender ID from step 2. Auth Key from Step 4. Flow ID is the Template ID from step 3.
  6. Run this command from @Steven
TypeScript
docker compose restart appwrite-worker-messaging```
Drake
28 Oct, 2023, 15:33

Please create a new <#1072905050399191082> post

Drake
28 Oct, 2023, 15:34
Drake
28 Oct, 2023, 15:35

[CLOSED] msg91 does not work for otp

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more