thankful-dog-96817
07/08/2022, 12:41 PM{
"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"
}
}
thankful-dog-96817
07/08/2022, 12:42 PMtemplates:
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>
thankful-dog-96817
07/08/2022, 12:42 PM(too long)
thankful-dog-96817
07/08/2022, 12:43 PM#!/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"
thankful-dog-96817
07/08/2022, 12:44 PMVerificationURL
thankful-dog-96817
07/08/2022, 12:44 PMthankful-dog-96817
07/08/2022, 12:44 PMthankful-dog-96817
07/08/2022, 12:45 PMRecoveryURL
🤦♂️thankful-dog-96817
07/08/2022, 12:45 PMhigh-optician-2097