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

Feat phone auth 360dialog #4536

Closed

Conversation

aakashcodess
Copy link

What does this PR do?

This PR will add phone authentication with whatsapp using 360dialog.

Test Plan

To test you have to create a phoneSession.
To test you should have a live 360dialog api or it can be tested with 360dialog sandbox api
In .env file
_APP_SMS_PROVIDER = sms:https://template_name:api_key@dialog360
_APP_PHONE_FROM = template_namespace

Related PRs and Issues

NO

Have you added your change to the Changelog?

N0

Have you read the Contributing Guidelines on issues?

Yes

@aakashcodess
Copy link
Author

360dialog takes 4 parameters to send a message Api-key, template name, template namespace, template language.
for now i have hard coded language to english on L41

More details regarding templates can be found on https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/

@aakashcodess
Copy link
Author

We can get template name, template namespace, template language for whatsapp business template settings. Added screenshots from whatsapp/facebook business manager templates settings page.
But first we have to apply for a whatsapp template with one variable in our template which will get replaced with secret from appwrite when sending message. (added screenshot of both approved template and received message)
whatsapp-template-example
Screenshot 2022-10-20 at 12 17 59 AM
Screenshot 2022-10-20 at 12 18 21 AM

@stnguyen90 stnguyen90 self-requested a review October 20, 2022 18:57
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

This is AMAZING! 🤯 I've left some request for changes. Please make sure to create a PR in the Utopia Messaging library. We can leave this for later when we update Appwrite to use the Messaging library.

src/Appwrite/SMS/Adapter/Dialog360.php Outdated Show resolved Hide resolved
src/Appwrite/SMS/Adapter/Dialog360.php Outdated Show resolved Hide resolved
src/Appwrite/SMS/Adapter/Dialog360.php Outdated Show resolved Hide resolved
src/Appwrite/SMS/Adapter/Dialog360.php Outdated Show resolved Hide resolved
@aakashcodess
Copy link
Author

Hey @stnguyen90, I have made the requested changes and also added the sandbox adapter. Will add the adapter in Utopia Messaging library too.

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

I have made the requested changes and also added the sandbox adapter. Will add the adapter in Utopia Messaging library too.

@aakashcodess, sorry I wasn't suggesting to make edits in this PR. It might be best to close this PR and just add the new Adapters in the Utopia Messaging library.

Btw, when making your chan get in the Utopia Messaging library, make sure to have 1 Adapter subclass the other to reduce the duplicate code.

@aakashcodess
Copy link
Author

@stnguyen90 Thanks for the update. I will add new adapters in messaging library.

@stnguyen90 stnguyen90 reopened this Oct 31, 2022
@stnguyen90 stnguyen90 added the hacktoberfest-accepted Accepted for Hacktoberfest, will be merged later label Oct 31, 2022
@stnguyen90
Copy link
Contributor

Adding hacktoberfest-accepted so you get some credit for Hacktoberfest. We'll clean this up and merge it later.

@christyjacob4 christyjacob4 removed the hacktoberfest-accepted Accepted for Hacktoberfest, will be merged later label Apr 6, 2023
@christyjacob4
Copy link
Member

@aakashcodess thanks a lot for your contributions during Hacktoberfest 2022!

Please reach out to me on our Discord server if you would like to claim your Appwrite swags! As a way of saying thank you, we would also love to invite you to join the Appwrite organization on GitHub. Please share your GitHub username with us on Discord. 

Also let us know if you're willing to continue working on it?

@aakashcodess
Copy link
Author

@christyjacob4 yes, I will resume working on it this weekend. I will message you on discord to join the github org.

@gewenyu99
Copy link

@aakashcodess How's it going with this auth provider? Can we do anything to help?

@aakashcodess
Copy link
Author

@aakashcodess How's it going with this auth provider? Can we do anything to help?

Hey @gewenyu99 , I was on break, I will start working on it. If I face any issue, I will ping you on discord.

@aakashcodess aakashcodess force-pushed the feat-phoneAuth-360dialog branch 2 times, most recently from 4d060f0 to fd7a2cb Compare June 17, 2023 12:06
@aakashcodess
Copy link
Author

Hey @stnguyen90 @gewenyu99 , I wanted to finish this. I didn't had access to live 360dialog api, now i do have access to 360dialog api key, can I continue to work on this. Or i can add the adapter (twilio whatsapp and 360dialog whatsapp) in messaging library.

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.

None yet

4 participants