<@U04UQ68083H> Using Ory Network self-service regi...
# ory-copilot
b
@chilly-king-10285 Using Ory Network self-service registration, is it possible to add a message like "By signing up, you agree to our [terms of service]" with a link to an external page?
b
A message from kapa.ai
Yes, it is possible to add a message like "By signing up, you agree to our terms of service" with a link to an external page when using Ory Network self-service registration. This can be achieved by customizing the registration flow and adding a custom field to the identity schema. Here's how you can implement this: 1. First, you need to modify your identity schema to include a field for the terms of service agreement. You can do this by adding a boolean field to your identity schema, for example:
Copy code
json
{
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              }
            },
            "verification": {
              "via": "email"
            },
            "recovery": {
              "via": "email"
            }
          }
        },
        "tos": {
          "type": "boolean",
          "title": "Accept Terms of Service",
          "default": false
        }
      },
      "required": [
        "email",
        "tos"
      ]
    }
  }
}
This example is based on the identity schema shown in the [Ory documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#registration-with-usernameemail-and-password). 2. After updating your identity schema, the registration flow will automatically include a checkbox for the terms of service agreement. The checkbox will appear in the UI as shown in this example from the documentation:
Copy code
json
{
  "type": "input",
  "group": "password",
  "attributes": {
    "name": "traits.tos",
    "type": "checkbox",
    "required": true,
    "disabled": false,
    "node_type": "input"
  },
  "messages": [],
  "meta": {
    "label": {
      "id": 1070002,
      "text": "Accept Tos",
      "type": "info"
    }
  }
}
[Source](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#create-registration-flow) 3. To add a custom message with a link to your terms of service, you'll need to customize the registration template. You can do this by following the instructions in the [Email templates documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates). 4. In your custom template, you can add the message with the link to your terms of service. For example:
Copy code
html
<form action="{{action}}" method="POST">
  {{#each nodes}}
    <!-- Render other form fields -->
  {{/each}}
  
  <p>By signing up, you agree to our <a href="https://your-website.com/terms-of-service">terms of service</a>.</p>
  
  <button type="submit">Sign up</button>
</form>
Remember to replace
<https://your-website.com/terms-of-service>
with the actual URL of your terms of service page.
New message text here