Skip to content

Encoding detection, support for non-latin characters in SMS#21

Merged
mbardelmeijer merged 12 commits intolaravel-notification-channels:masterfrom
marventhieme:feature/encoding-detection
Jan 29, 2025
Merged

Encoding detection, support for non-latin characters in SMS#21
mbardelmeijer merged 12 commits intolaravel-notification-channels:masterfrom
marventhieme:feature/encoding-detection

Conversation

@marventhieme
Copy link
Contributor

@marventhieme marventhieme commented Jan 28, 2025

Related issue: #20

In order to support automatic encoding detection, I have moved from an XML body to a JSON body.
The basic structure/content is the same.

BREAKING CHANGE:
Tariffs do not seem to be supported anymore.
We can still declare them and CM responds with "Created 1 message(s)" but the SMS does not reach its destination.

Changed

  • Moved from XML to JSON for the request body
  • Changed CM endpoint
  • Error handling: The response body is now always filled and we listen for the errorCode property

Added

  • Added config option services.cmsms.encoding_detection_type with default AUTO
  • Two events for success and failure: SMSSentSuccessfullyEvent and SMSSendingFailedEvent

@marventhieme marventhieme changed the title WIP: Feature/encoding detection Encoding detection, support for non-latin characters in SMS Jan 28, 2025
@mbardelmeijer
Copy link
Collaborator

Cool!! Thanks a lot for the in-depth PR. I've done a quick scan and looks really good.

The tariff stuff is a shame; it was the primary reason we created this package (the project we worked on required that for it's business case), but has since stopped, so we just maintain the package now without CM usage in our projects. So can't really test it from our end, but from a technical perspective it looks good.

Will do one more pass later and merge if all good 😄

@marventhieme
Copy link
Contributor Author

As I did not find anything useful regarding tariffs in their documentation, can you share some use cases and values you have set? Maybe I have just tested it wrong. Do you know of any documentation on that topic (even if it is an old one)?

@mbardelmeijer
Copy link
Collaborator

As I did not find anything useful regarding tariffs in their documentation, can you share some use cases and values you have set? Maybe I have just tested it wrong. Do you know of any documentation on that topic (even if it is an old one)?

Yeah the tariff thing was for us around 9 years ago, so don't really recall the exact implementation or have any documentation anymore. All I know is that it was via that original XML implementation and the old logic remained. But happy to merge this without tariff support.

Copy link
Collaborator

@mbardelmeijer mbardelmeijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added my comments/review on the PR. Other than that, looks good to merge after these small changes 😄

@marventhieme
Copy link
Contributor Author

Done implementing your changes, thanks for those!

@mbardelmeijer mbardelmeijer merged commit 93e1dc1 into laravel-notification-channels:master Jan 29, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants