<@U04UQ68083H> How do I configure SMS support in a...
# ory-copilot
s
@chilly-king-10285 How do I configure SMS support in a yaml config file for Ory Network
c
A message from kapa.ai
To configure SMS support in a yaml config file for Ory Network, you need to follow these steps: 1. Download the Ory Identities config from your project and save it to a file using the Ory CLI:
Copy code
bash ## List all available projects   ory list projects      ## Get config   ory get identity-config {project-id} --format yaml > identity-config.yaml
2. Add the configuration for your custom SMTP server to the config.yml file:
Copy code
yaml courier:     channels:       - id: sms         type: http         request_config:           url: <https://api.twilio.com/2010-04-01/Accounts/AXXXXXXXXXXXXXX/Messages.json> # Adjust your account ID           method: POST           body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgVG86IGN0eC5yZWNpcGllbnQsCiAgQm9keTogY3R4LmJvZHksCn0>= # see below           headers:             Content-Type: application/x-www-form-urlencoded # defaults to application/json           auth:             type: basic_auth # or api_key             config:               user: AXXXXXXX # adjust your credentials               password: XXXX # adjust your credentials
3. Update the Ory Identities configuration using the file you worked with:
Copy code
bash ory update identity-config {project-id} --file updated_config.yaml
Please note that the body of the request_config decodes to the following Jsonnet template:
Copy code
jsonnet function(ctx) {    To: ctx.recipient,    Body: ctx.body,   }
Fields available on the
ctx
object are: - `recipient`: The recipient's phone number - `body`: The message body - `template_type`: The template type, e.g.
verification_code
- `template_data`: The template data, e.g.
{ "VerificationCode": "1234", Idenity: { ... } }
- `message_type`: The message type, e.g.
sms
You can read more about this in the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/sending-sms).