#MSG 91 ERROR
40 messages · Page 1 of 1 (latest)
i also tried this from the other thread
docker compose restart appwrite-worker-messaging```
but its still the same
this should be the body according to the docs https://docs.msg91.com/reference/send-sms
{
"template_id":"EntertemplateID", "short_url": "1 (On) or 0 (Off)", "recipients" : [
{
"mobiles":"919XXXXXXXXX",
"VAR1": "VALUE1",
"VAR2": "VALUE2"
}
]
}
can you share the logs from the appwrite-worker-messaging container?
[Worker] Worker 0 is ready!
Worker messaging started
[Job] Received Job (653fbb9decc3f0.46010726).
[Job] (653fbb9decc3f0.46010726) successfully run.
Womp...not helpful
What was the output of this?
its just 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 WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. WARN[0000] The "Usssf" variable is not set. Defaulting to a blank string. [+] Restarting 1/1 ✔ Container appwrite-worker-messaging Started 10.4s
That's weird...it may not have set properly...can you go into the container to see the Msg91.php file?
Yes i can
What do i have to do it with the Msg91.php file?
Share the code in the process function
its
protected function process(SMS $message): string
{
$to = \array_map(
fn ($to) => ['mobiles' => \ltrim($to, '+')],
$message->getTo()
);
return $this->request(
method: 'POST',
url: 'https://api.msg91.com/api/v5/flow/',
headers: [
'content-type: application/json',
"authkey: {$this->authKey}",
],
body: \json_encode([
'sender' => $this->senderId,
'otp' => $message->getContent(),
'flow_id' => $message->getFrom(),
'recipients' => $to,
]),
);
}
Hmm...this does look right
its getting the auth key proper.. and also flow id
but only the messge and mobile is missing
Can you share your flow?
flow in the sense template id?
The actual flow or template
its
Hi, Your login OTP is ##otp## . Please do not share it with anyone.
-RBMSMS
Do you have Usssf in your env or docker-compose.yml somewhere?
I have no idea.. but it just keeps appearing everything i upgrade appwrite or migrate
But the Usssf never gave me any trouble
Search please
and in docker compose file there are no occurances
Ya...dollar signs would get interpolated improperly
oh how to fix it?
just remove the $ sign ?
yes you are right
Set it to that then
should i restart the appwrite stack?
Recreate with docker compose up -d
Then run this again
this time it ran without any errors
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
[+] Restarting 1/1
✔ Container appwrite-worker-messaging Started 10.5s
Lol I'm surprised but I'll take it 🤣
I don't really understand why the incorrect openssl key would make the sms not send