Skip to content

Commit

Permalink
Use dashboard name instead of subscription name for emails
Browse files Browse the repository at this point in the history
  • Loading branch information
grios-stratio committed Jan 23, 2024
1 parent c7a80ca commit fa5a7bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/metabase/email/messages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@
(defn- pulse-context [pulse dashboard]
(merge (common-context)
{:emailType "pulse"
:title (:name pulse)
;; < STRATIO - use dashboard name instead of pulse name for emails
;; :title (:name pulse)
:title (or (:name dashboard) (:name pulse))
;; STRATIO >
:titleUrl (params/dashboard-url (:id dashboard) (params/parameters pulse dashboard))
:dashboardDescription (:description dashboard)
:creator (-> pulse :creator :common_name)
Expand Down Expand Up @@ -449,6 +452,7 @@
:filters filters
:iconCid (:content-id icon-attachment))
attachments (apply merge (map :attachments rendered-cards))]

(vec (concat [{:type "text/html; charset=utf-8" :content (stencil/render-file "metabase/email/pulse" message-body)}]
(map make-message-attachment attachments)
[icon-attachment]
Expand Down
5 changes: 4 additions & 1 deletion src/metabase/pulse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@
query-results (filter :card results)
timezone (-> query-results first :card defaulted-timezone)
dashboard (Dashboard :id dashboard-id)]
{:subject (subject pulse)
;; < STRATIO - use dashboard name instead of pulse name for emails
;; {:subject (subject pulse)
{:subject (or (:name dashboard) (subject pulse))
;; STRATIO >
:recipients email-recipients
:message-type :attachments
:message (messages/render-pulse-email timezone pulse dashboard results)}))
Expand Down

0 comments on commit fa5a7bf

Please sign in to comment.