電話番号バリデーション

Hello Support,

I am trying to validate the phone number which user enters during registration. So I added few user fields to registration screen. So I make the user enter his phone number.
I also have added code in the themes JS section, which can send a OTP to user.

I have not been able to figure out the best way to take the phone number from profile and send an sms to it.
What I have tried:
Use a wizard after registration. It will run automatically.

  1. When it opens, I need the phone number of the profile. (I see that wizard can get default attributes like username u{username}, but not my custom field phonenumber u{phone})
  2. When I get the number (which I can make the user enter in a field again), how to call my JS code which I entered in the theme JS section.
    I have seen that when a normal page is loaded, api.onPageChange((url) => {
    This works. But when wizard gets loaded, this does not work.
    I tried using the document model,

if (‘Discourse’ in window) {
if (‘Discourse’ in window && typeof Discourse._registerPluginCode === ‘function’) {
Discourse._registerPluginCode
But register plugin fails.

So I am not sure, if I am on the right track or if there might be a simple way of taking the phone number and executing a custom JS code for sending sms.

Thanks,
Prashanth

「いいね!」 1

I’m far from a maven on the Ember side, so perhaps you can do something there, but I doubt it. I think you’ll need a plugin.

「いいね!」 2

すみません、ここでの目的は何ですか?サインアップ時に有効な電話番号を要求することですか?

「いいね!」 1

Custom Wizard Plugin 🧙 でこれを行いましたか?

詳細をお聞かせいただけると幸いです。

「いいね!」 1

実際にどのように達成しましたか?「正しい変数形式を使用してカスタムフィールド経由で渡した」とはどういう意味かよくわかりません。

提案されたサイトは一見すると信頼できないように思えます。

会社に関する情報がゼロ。誰が運営しているのか?どの国で?
自動生成されたプライバシーポリシー。未定義のプレースホルダー(フッターの「© 0001」など)…

全く信頼できません。

「いいね!」 1

また、投稿された後、質問された際に、回答する代わりに最初の投稿が削除され、リンク付きの同じ投稿が再投稿されました。

「いいね!」 2