> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 多要素認証のSMSおよび音声メッセージをカスタマイズする

> 登録時および検証時に Auth0 が送信する SMS と音声メッセージをカスタマイズする方法を説明します。

Auth0 が送信する多要素認証の SMS および音声メッセージをカスタマイズするには、次の手順に従います。

1. [Dashboard > Security > Multi-factor Auth](https://manage.auth0.com/#/security/mfa) に移動し、**Phone Message** をクリックします。
2. **Enrollment Template** または **Verification Template** セクションで、メッセージをカスタマイズします。
3. **Save** をクリックします。

**Enrollment Template** では、ユーザーが MFA を使用して初めて新しいデバイスを登録する際に送信されるメッセージを定義します。**Verificiation Template** では、ユーザーが登録後にログインする際に送信されるメッセージを定義します。

<div id="syntax">
  ## 構文
</div>

SMS テンプレートでユーザー属性にアクセスする際に使用できるサポート対象のテンプレートエンジンは、[Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) 構文です。利用可能な属性は次のとおりです。

| Attribute                       | Description                                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------ |
| `message_type`                  | 送信されるメッセージの種類を示します: `sms` または `voice`。                                                     |
| `code`                          | 登録/確認コード。音声メッセージを送信する場合は、音声メッセージプロバイダーが正確に発音できるよう、変数値の各数字の間にドットを入れて区切ります (`1.2.3.4.5`)。    |
| `locale`                        | Universal Login または MFA API 用です。言語を指定します。                                                  |
| `requestInfo.lang`              | Classic Login のローカライズ用です。ブラウザーの accept-language ヘッダーを示します。例: `es-AR,es;q=8.0`, `en-US,en`。 |
| `tenant.friendlyName`           | **Dashboard > Tenant Settings** で設定した **Friendly Name**。                                   |
| `custom_domain.domain`          | テナントのドメイン名。                                                                                |
| `custom_domain.domain_metadata` | カスタムドメインのメタデータフィールド (キーと値のペア) 。                                                            |

Liquid 構文を使用して、言語ごとに音声メッセージと SMS で異なるメッセージを送信する例を次に示します。

```liquid lines theme={null}
{% if message_type == "voice" %}
    {% if locale contains "fr" %}
        Bonjour, vous avez demandé à recevoir un code de vérification pour vous enregister avec {{tenant.friendly_name}}. Votre code est: {{pause}} {{code}}. Je répète, votre code est: {{pause}}{{code}}.
    {% elsif locale contains "es" %}
        Usted ha requerido un código de verificación para inscribirse con {{tenant.friendly_name}}. Su código es: {{pause}}{{code}}. Repito, su código es: {{pause}}{{code}}.
    {% else %}
        Hello, you requested a verification code to enroll with {{tenant.friendly_name}}. Your code is: {{pause}}{{code}}. I repeat, your code is: {{pause}}{{code}}.
    {% endif %}
{% else %}
    {% if locale contains "fr" %}
        {{code}} est votre code de vérification pour vous enregistrer avec {{tenant.friendly_name}}.
    {% elsif locale contains "es" %}
        {{code}} es su código para inscribirse con {{tenant.friendly_name}}.
    {% else %}
        {{code}} is your verification code to enroll with {{tenant.friendly_name}}.
    {% endif %}
{% endif %}
```

<div id="localization">
  ## ローカライズ
</div>

Auth0 Authentication API では、[Code または Link の取得エンドポイント](https://auth0.com/docs/api/authentication/passwordless/get-code-or-link)、MFA の[チャレンジリクエストエンドポイント](https://auth0.com/docs/api/authentication/muti-factor-authentication/request-mfa-challenge)、および MFA の[認証要素追加エンドポイント](https://auth0.com/docs/api/authentication/muti-factor-authentication/add-an-authenticator)で `x-request-language` ヘッダーがサポートされています。

これを使用するには、**Tenant > Settings** の **Supported Languages** でサポートする言語を設定します。`x-request-lanuage` ヘッダーが送信されると、そのロケールは MFA の電話メッセージテンプレート内の `locale` 変数で利用できます。詳細は、[パスワードレスの多言語サポート](/ja/docs/authenticate/passwordless/authentication-methods/sms-otp#multi-language-support)を参照してください。

<div id="learn-more">
  ## 詳細はこちら
</div>

* [多要素認証 (MFA) ](/ja/docs/secure/multi-factor-authentication)
* [MFA の SMS 通知と音声通知を設定する](/ja/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-sms-voice-notifications-mfa)
* [SMS および音声の認証要素の登録とチャレンジ](/ja/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa/enroll-challenge-sms-voice-authenticators)
