<@U04UQ68083H> how can i set custom account recove...
# ory-copilot
a
@chilly-king-10285 how can i set custom account recovery mail templateintead of bultin template
c
A message from kapa.ai
To set a custom account recovery email template in Ory, you can follow these steps: 1. Encode your custom template to base64. You can use the following command:
Copy code
bash echo "Your custom template" | base64
or use an online tool like https://www.base64encode.org/. 2. Add your Base64-encoded custom message templates to the config. Don't forget to add
base64://
before the encoded template. Here is an example of how to do it:
Copy code
yaml courier:     smtp:       from_name: MyProject via Ory       templates:         recovery:           invalid:             email:               body:                 html: "<base64://ENCODED_HTML_TEMPLATE>"                 plaintext: "<base64://ENCODED_PLAINTEXT_TEMPLATE>"           valid:             email:               body: {}
3. Upload the edited config:
Copy code
bash ory update identity-config <project-id> --file updated_config.yaml
In the Ory Network, you can use only Base64-encoded templates.
http://
or
file://
URIs are not supported. If you provide custom templates using unsupported methods, the system uses the default templates. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates).
a
@chilly-king-10285 here is my config. courier: smtp: connection_uri: smtps://test:test@mailslurper:1025/?skip_ssl_verify=true from_name: MyProject via Ory templates: recovery: invalid: email: body: html: base64://QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSB2ZXJpZnkgeW91ciBhY2NvdW50IGJ5IGNsaWNraW5nIHRoZSBmb2xsb3dpbmcgbGluazp7eyAuUmVjb3ZlcnlDb2RlIH19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg== plaintext: base64://SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg== valid: email: body: html: base64://QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg== plaintext: base64://SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg== is it correct or not?
c
A message from kapa.ai
Your configuration seems correct, assuming that the base64 strings are valid and correctly encode your HTML and plaintext templates. Just make sure to replace the placeholders
<smtps://test:test@mailslurper:1025/?skip_ssl_verify=true>
and
<base64://...>
with your actual values. Also, ensure that your base64 encoded strings do not contain any line breaks, as they can cause issues. Here is how your configuration should look like:
Copy code
yaml courier:   smtp:     connection_uri: <smtps://test:test@mailslurper:1025/?skip_ssl_verify=true>     from_name: MyProject via Ory   templates:     recovery:       invalid:         email:           body:             html: <base64://QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSB2ZXJpZnkgeW91ciBhY2NvdW50IGJ5IGNsaWNraW5nIHRoZSBmb2xsb3dpbmcgbGluazp7eyAuUmVjb3ZlcnlDb2RlIH19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg>==             plaintext: <base64://SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg>==       valid:         email:           body:             html: <base64://QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg>==             plaintext: <base64://SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg>==
For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates).
a
i still did not get the desired custom email? @chilly-king-10285
c
A message from kapa.ai
If you're not receiving the custom email as expected, there could be a few reasons: 1. SMTP Server Connection: Check your SMTP server connection details in the
connection_uri
field. Make sure the server is reachable and the credentials are correct. 2. Base64 Encoding: Ensure that your base64 encoded strings are correct and they decode to the expected HTML and plaintext templates. You can use online tools to verify your base64 encoding. 3. Email Delivery Issues: If the email's status is
Sent
, but it did not arrive, please check the spam folder or the logs of your custom SMTP server (if configured). You can view outgoing messages on the MonitoringEmail Delivery page in the [Ory Console](https://console.ory.sh/projects/current/email-delivery). 4. Configuration Update: Make sure you've updated the configuration correctly using the
ory update identity-config <project-id> --file updated_config.yaml
command. 5. Unsupported Methods: In the Ory Network, only Base64-encoded templates are supported.
http://
or
file://
URIs are not supported. If you provide custom templates using unsupported methods, the system uses the default templates. If you're still facing issues, you might want to refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates) or seek help from the Ory community.
a
how to find project id for that command @chilly-king-10285
c
A message from kapa.ai
To find the project ID for your Ory project, you can use the
ory list projects
command. Here is how you can do it:
Copy code
bash ory list projects
This command will list all available projects and their IDs. You can find the
project_id
in the output of this command. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/guides/gitops#ory-identities-configuration).
a
ory is not recongnized in in kratos repo @chilly-king-10285
c
A message from kapa.ai
It seems like you're trying to use the
ory
command but your system doesn't recognize it. This could be because the Ory CLI is not installed or not added to your system's PATH. To install the Ory CLI, you can follow these steps based on your operating system: For Linux:
Copy code
bash bash <(curl <https://raw.githubusercontent.com/ory/meta/master/install.sh>) -d -b . kratos <version-you-want> sudo mv ./kratos /usr/local/bin/ kratos help
For macOS:
Copy code
bash brew install ory/tap/kratos kratos help
For Windows:
Copy code
bash scoop bucket add ory <https://github.com/ory/scoop.git> scoop install kratos kratos help
Replace
<version-you-want>
with the version of Ory Kratos you want to install. After installation, you should be able to use the
ory
command. If you're still having issues, make sure that the Ory CLI binary is correctly added to your system's PATH. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/install).
a
@chilly-king-10285 after encoding to base 64 using online tool, this is my encoded html QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSB2ZXJpZnkgeW91ciBhY2NvdW50IGJ5IGNsaWNraW5nIHRoZSBmb2xsb3dpbmcgbGluazp7eyAuUmVjb3ZlcnlDb2RlIH19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg== and this is my encoded plaintext SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg== now how should i use it for custom email
c
A message from kapa.ai
You can use your base64 encoded HTML and plaintext strings in your Ory configuration file. Here's how you can do it: 1. Open your Ory configuration file (
identity-config.yaml
or
config.yml
). 2. Locate the
courier
section and then the
templates
subsection. 3. Under the
recovery
section, replace the
html
and
plaintext
fields under
invalid
and
valid
with your base64 encoded strings. Make sure to prepend the strings with
base64://
. Here's an example of how your configuration should look:
Copy code
yaml courier:     smtp:       from_name: MyProject via Ory       templates:         recovery:           invalid:             email:               body:                 html: "<base64://QWxsIHByYWlzZSBpcyBmb3IgQWxsYWgsIHBsZWFzZSB2ZXJpZnkgeW91ciBhY2NvdW50IGJ5IGNsaWNraW5nIHRoZSBmb2xsb3dpbmcgbGluazp7eyAuUmVjb3ZlcnlDb2RlIH19Cgo8YSBocmVmPSJ7eyAuUmVjb3ZlcnlDb2RlIH19Ij57eyAuUmVjb3ZlcnlDb2RlIH19PC9hPg>=="                 plaintext: "<base64://SGksIHBsZWFzZSByZWNvdmVyIGFjY2VzcyB0byB5b3VyIGFjY291bnQgYnkgZW50ZXJpbmcgdGhlIGZvbGxvd2luZyBjb2RlOnt7LlJlY292ZXJ5Q29kZX19Cg>=="           valid:             email:               body: {}
4. Save the configuration file. 5. Upload the edited config using the Ory CLI:
Copy code
bash ory update identity-config <project-id> --file identity-config.yaml
Replace
<project-id>
with your actual project ID. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates#using-custom-message-templates).
a
i dont know my project id @chilly-king-10285
c
A message from kapa.ai
To find your project ID, you can use the Ory CLI with the
list projects
command. Here's how you can do it:
Copy code
bash ory list projects
This command will list all your projects along with their details, including the project ID. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/guides/cli/cli-basics#create-a-project).
a
@chilly-king-10285 PS C:\Users\DLL\Documents\GitHub\kratos> ory lisy projects ory : The term 'ory' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + ory lisy projects i get this error after the command
c
A message from kapa.ai
It seems like you're trying to use the
ory
command but your system doesn't recognize it. This could be because the Ory CLI is not installed or not added to your system's PATH. To install the Ory CLI, you can follow these steps based on your operating system: For Linux:
Copy code
bash bash <(curl <https://raw.githubusercontent.com/ory/meta/master/install.sh>) -d -b . kratos <version-you-want> sudo mv ./kratos /usr/local/bin/ kratos help
For macOS:
Copy code
bash brew install ory/tap/kratos kratos help
For Windows:
Copy code
bash scoop bucket add ory <https://github.com/ory/scoop.git> scoop install kratos kratos help
Replace
<version-you-want>
with the version of Ory Kratos you want to install. After installation, you should be able to use the
ory
command. If you're still having issues, make sure that the Ory CLI binary is correctly added to your system's PATH. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/install).