sparse-father-97864
06/07/2024, 6:38 PMchilly-king-10285
06/07/2024, 6:38 PMchilly-king-10285
06/07/2024, 6:38 PMbash ## 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: 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: 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: 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).