Closed sts-ryan-holton closed 1 year ago
I also getting this issue also. Hope someone can help.
@dungnh For now, I've had to rollback my version of this package.
Hopefully a solution/fix soon! 👍
Will be a short turnaround for this, on it now.
Release 4.0.6 of the Vonage SDK fixes the regex for this @sts-ryan-holton @dungnh
The other issue here - that the Vonage SDK is firing a warning which is being turned into an Exception is a different problem. If something is picking up the trigger_error
and converting it to an Exception, I'm tempted to either remove it altogether or get something like Monolog to put it in a logfile. I don't want to -stop- users from sending what they want to send, but I do want to warn them if it's the wrong encoding without an uncaught Exception stopping runtime.
@SecondeJK Thanks for this. Does this mean an update of this package won't be required? Maybe you can do some kind of config. In my system specifically I'm using a library to detect unicode characters and auto charge customers more credits per message.
You can run composer update to pull the latest in.
The important thing here is that the underlying Vonage SDK can check the encoding for you.
\Vonage\SMS\Message\SMS::isGsm7()
will give you back a boolean in order for you to decide whether to use Laravel's unicode()
Cool. So is your suggestion to wrap the part where I send a message in a if
statement for this part of my code:
try {
$amount = $this->getNumberOfDeductableCredits($this->message->data['body']);
$this->createCreditTransaction($message, $amount);
return (new VonageMessage)
->clientReference($this->message->id)
->content($this->message->data['body']);
} catch (\Exception $e) { }
Something like...
try {
$amount = $this->getNumberOfDeductableCredits($this->message->data['body']);
$this->createCreditTransaction($message, $amount);
if (\Vonage\SMS\Message\SMS::isGsm7()) {
return (new VonageMessage)
->clientReference($this->message->id)
->content($this->message->data['body'])
->unicode();
}
return (new VonageMessage)
->clientReference($this->message->id)
->content($this->message->data['body']);
} catch (\Exception $e) { }
I guess the root issue here is resolved. Feel free to discuss further for anything else. Thanks
Description:
I've just tried sending a text message,, the same exact message that I sent in the previous version of this package. I'm getting an
ErrorException
thrown by the Vonage library:The message that I'm trying to send is:
This previously worked, now fails as a failed job.