enough-vase-33352
08/07/2025, 2:52 AMbrief-egg-61061
08/07/2025, 2:52 AMbrief-egg-61061
08/07/2025, 2:52 AMjsonnet function(ctx) { To: ctx.recipient, Body: ctx.body, }
- ctx.recipient
is the phone number of the user. - ctx.body
is the message content (such as a verification or login code). The template can access other variables as well, such as template_type
and template_data
, depending on the type of message being sent. The base64 encoding is required for the configuration to accept the template, and only base64-encoded templates are supported in Ory Network and most production setups for security and compatibility reasons [Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms). Example configuration snippet: yaml courier: channels: - id: sms type: http request_config: url: <https://api.twilio.com/2010-04-01/Accounts/AXXXXXXXXXXXXXX/Messages.json> method: POST body: base64://<base64-encoded-Jsonnet-template> headers: Content-Type: application/x-www-form-urlencoded auth: type: basic_auth config: user: <your-username> password: <your-password>
You can find more details and examples in the official documentation [Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms).