hi friends, I've got another issue trying to confi...
# talk-kratos
t
hi friends, I've got another issue trying to configure email in Ory cloud. I've configured a custom SMTP sender (works) and I'm now trying to configure custom email templates. I'm following the docs of course and I believe I've done everything correctly. I'm using b64 templates, the patch is accepted and I can see that the template payloads are saved to blob storage. when trying to reset password I get the following error:
Copy code
{
  "error": {
    "code": 500,
    "status": "Internal Server Error",
    "request": "c0cbcb3c-f6e4-95f3-a455-0d4a7e13ca2c",
    "message": "template: <https://storage.googleapis.com/bac-gcs-production/6aa3ed067c10a4cb8da51f7dfecfec2d7c911fd54ab88bf343029badc1bc813ba3c04f1e8aa3161b433e31fc26602e793f0d0271dc61d1a49be204957dcf04aa.bin:9:24>: executing \"<https://storage.googleapis.com/bac-gcs-production/6aa3ed067c10a4cb8da51f7dfecfec2d7c911fd54ab88bf343029badc1bc813ba3c04f1e8aa3161b433e31fc26602e793f0d0271dc61d1a49be204957dcf04aa.bin>\" at <.VerificationURL>: can't evaluate field VerificationURL in type *email.RecoveryValidModel"
  }
}
relevant config snapshot with working template urls to check
Copy code
templates:
  recovery:
    invalid:
      email:
        body: {}
    valid:
      email:
        body:
          html: <https://storage.googleapis.com/bac-gcs-production/ea7db8c1e28f09aa735a48dc52f81fd4677418f6709717665bdbc3202f597bbffc8747cbfdfb0932809b241f61421d1c9b432905e150adfba6383586db2302fc.html>
          plaintext: <https://storage.googleapis.com/bac-gcs-production/6aa3ed067c10a4cb8da51f7dfecfec2d7c911fd54ab88bf343029badc1bc813ba3c04f1e8aa3161b433e31fc26602e793f0d0271dc61d1a49be204957dcf04aa.bin>
for reference, here's the patch payload with the b64 values
Copy code
(too long)
and for good measure, here's the script I use
Copy code
#!/usr/bin/env bash

project="08cf0e35-1da3-4a99-bdab-1eea75d935ca"  # dev
# project="c4d26a79-a2c1-4407-9088-d60ff1c2b5d7"  # prod

name="recovery.valid"

html_layout=$(cat ./email_templates/_layout.html)
text_layout=$(cat ./email_templates/_layout.txt)

html_template=$(cat ./email_templates/$name.html)
text_template=$(cat ./email_templates/$name.txt)

html_body=$(echo "${html_layout/"{{{ @content }}}"/"$html_template"}")
text_body=$(echo "${text_layout/"{{{ @content }}}"/"$text_template"}")

key="/services/identity/config/courier/templates/recovery/valid/email/body"
value=$(
  jq --compact-output <<EOF
  {
    "html": "base64://$(echo "$html_body" | base64 -w0)",
    "plaintext": "base64://$(echo "$text_body" | base64 -w0)"
  }
EOF
)

echo "Setting $key to $value"

timestamp=$(date +%s)

ory get   project $project --format json | jq > "./snapshots/$timestamp.current.json"
ory get   project $project --format yaml      > "./snapshots/$timestamp.current.yaml"

ory patch project $project --replace "$key=$value"

ory get   project $project --format json | jq > "./snapshots/$timestamp.new.json"
ory get   project $project --format yaml      > "./snapshots/$timestamp.new.yaml"
any idea what the problem could be? the templates look ok to me. I don't understand why it complains about
VerificationURL
oh
OH
it should be
RecoveryURL
🤦‍♂️
what an idiot. thanks for listening 😆 🦆
❤️ 1
h
🙂