From 101bbe8bd8df7f319182b4f0a9614f682b549101 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Fri, 24 Apr 2026 18:11:16 +0200 Subject: [PATCH] :sparkles: Add organization logo to nitrate invitations emails --- backend/resources/app/email/invite-to-org/en.html | 4 ++-- backend/src/app/email.clj | 4 ++-- backend/src/app/rpc/commands/teams_invitations.clj | 9 +++++---- backend/src/app/rpc/management/nitrate.clj | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/backend/resources/app/email/invite-to-org/en.html b/backend/resources/app/email/invite-to-org/en.html index 45ec53596a..5ee16f6942 100644 --- a/backend/resources/app/email/invite-to-org/en.html +++ b/backend/resources/app/email/invite-to-org/en.html @@ -198,9 +198,9 @@
- {{org-initials}} + {% if organization-initials %}{{organization-initials}}{% endif %}
diff --git a/backend/src/app/email.clj b/backend/src/app/email.clj index 5e63d38744..fe57118a58 100644 --- a/backend/src/app/email.clj +++ b/backend/src/app/email.clj @@ -416,8 +416,8 @@ [:map [:invited-by ::sm/text] [:organization-name ::sm/text] - [:org-initials ::sm/text] - [:org-logo ::sm/uri] + [:organization-initials [:maybe :string]] + [:organization-logo ::sm/uri] [:user-name [:maybe ::sm/text]] [:token ::sm/text]]) diff --git a/backend/src/app/rpc/commands/teams_invitations.clj b/backend/src/app/rpc/commands/teams_invitations.clj index aaa4f22bc3..51a64a7276 100644 --- a/backend/src/app/rpc/commands/teams_invitations.clj +++ b/backend/src/app/rpc/commands/teams_invitations.clj @@ -91,6 +91,7 @@ [:map [:id ::sm/uuid] [:name :string] + [:initials [:maybe :string]] [:logo ::sm/uri]]] [:profile [:map @@ -211,8 +212,8 @@ :invited-by (:fullname profile) :user-name (:fullname member) :organization-name (:name organization) - :org-logo (:logo organization) - :org-initials (d/get-initials (:name organization)) + :organization-logo (:logo organization) + :organization-initials (:initials organization) :token itoken :extra-data ptoken})) (let [team (if (contains? cf/flags :nitrate) @@ -231,11 +232,11 @@ itoken))))) (defn create-org-invitation - [cfg {:keys [::rpc/profile-id id name logo] :as params}] + [cfg {:keys [::rpc/profile-id id name initials logo] :as params}] (let [profile (db/get-by-id cfg :profile profile-id)] (create-invitation cfg (assoc params - :organization {:id id :name name :logo logo} + :organization {:id id :name name :initials initials :logo logo} :profile profile :role :editor)))) diff --git a/backend/src/app/rpc/management/nitrate.clj b/backend/src/app/rpc/management/nitrate.clj index 8af099de97..0e7479ac6c 100644 --- a/backend/src/app/rpc/management/nitrate.clj +++ b/backend/src/app/rpc/management/nitrate.clj @@ -360,6 +360,7 @@ RETURNING id, name;") [:email ::sm/email] [:id ::sm/uuid] [:name ::sm/text] + [:initials [:maybe :string]] [:logo ::sm/uri]]} [cfg params] (db/tx-run! cfg ti/create-org-invitation params)