melodic-actor-58085
04/05/2024, 3:23 PMchilly-king-10285
04/05/2024, 3:23 PMchilly-king-10285
04/05/2024, 3:23 PMdelivery_strategy
configuration key to http
and provide the necessary details for your HTTP server. Here are the steps to do this: 1. Download the Ory Identities config from your project and save it to a file using the Ory CLI: 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 HTTP server to the config.yml
file: yaml courier: delivery_strategy: http http: request_config: url: <https://mail-sender.example.com> method: POST body: base64://... # See below for the default payload and available variables headers: Content-Type: application/json auth: # leave out, if your server doesn't require authentication, but note that we don't recommend that type: basic_auth # or api_key config: user: my-username password: my-password # if you want to use an API key (type: api_key), use the following config instead: # name: my-api-name # value: my-api-key-value # in: header # or cookie
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 payload of the HTTP request is a JSON object that's generated using a Jsonnet template. You can customize the payload according to your needs. The Ory Console doesn't support configuring this yet, so you need to use the Ory CLI. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp#send-emails-using-an-http-server).melodic-actor-58085
04/05/2024, 3:27 PMchilly-king-10285
04/05/2024, 3:28 PMchilly-king-10285
04/05/2024, 3:28 PMyaml courier: delivery_strategy: http http: request_config: url: <https://mail-sender.example.com> method: POST body: base64://... # See below for the default payload and available variables headers: Content-Type: application/json auth: # leave out, if your server doesn't require authentication, but note that we don't recommend that type: basic_auth # or api_key config: user: my-username password: my-password # if you want to use an API key (type: api_key), use the following config instead: # name: my-api-name # value: my-api-key-value # in: header # or cookie
Remember to replace the placeholders with your actual values. After making these changes, you can update the Ory Identities configuration using the Ory CLI: bash ory update identity-config {{project-id}} --file updated_config.yaml
For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-hosted/email-http).melodic-actor-58085
04/05/2024, 3:38 PMchilly-king-10285
04/05/2024, 3:38 PMchilly-king-10285
04/05/2024, 3:38 PMcourier.smtp.connection_uri
field in the configuration, even if you're not using SMTP for email delivery. However, you can work around this by providing a dummy SMTP URI. This way, the configuration validation will pass, but since you've set the delivery_strategy
to http
, Kratos will still use the HTTP method for sending emails. Here's an example: yaml courier: delivery_strategy: http smtp: connection_uri: <smtp://dummy:dummy@dummy:587> http: request_config: url: <https://mail-sender.example.com> method: POST body: base64://... # See below for the default payload and available variables headers: Content-Type: application/json auth: # leave out, if your server doesn't require authentication, but note that we don't recommend that type: basic_auth # or api_key config: user: my-username password: my-password # if you want to use an API key (type: api_key), use the following config instead: # name: my-api-name # value: my-api-key-value # in: header # or cookie
Remember to replace the placeholders with your actual values. After making these changes, you can update the Ory Identities configuration using the Ory CLI: bash ory update identity-config {{project-id}} --file updated_config.yaml
For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-hosted/email-http).melodic-actor-58085
04/05/2024, 4:04 PMcourier:
delivery_strategy: http
http:
request_config:
url: <http://emails:8080/api>
method: POST
body: <base64://__EMAIL_JSONNET__>
headers:
Content-Type: application/json
smtp: # Kratos bug, see: <https://github.com/ory/kratos/issues/3559>
connection_uri: <smtps://foo:bar@my-mailserver:1234/?skip_ssl_verify=false>
after we updated our self-hosted kratos instance from 1.0 to 1.1 the kratos internals always pick email as channels instead of http. We don't want to use the smpt or email channel but rather the http sending methodchilly-king-10285
04/05/2024, 4:04 PMchilly-king-10285
04/05/2024, 4:04 PMbash ory update identity-config {{project-id}} --file updated_config.yaml
3. Contact Ory Support: If you're still having issues, it might be best to reach out to Ory support or open an issue on the Ory Kratos GitHub page. They might be able to provide more specific guidance based on your setup. Remember to replace {{project-id}}
and updated_config.yaml
with your actual project ID and the path to your configuration file. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-hosted/email-http).