【发布时间】:2016-02-22 19:45:01
【问题描述】:
我正在尝试使用 riemann 在电子邮件的正文部分创建自定义消息。 我无法动态附加该字段。
黎曼配置:
(let [email (mailer
{:host "XXXXX" :port XX :user "XXX" :pass "XXX" :auth "true"
:subject (fn [events] "Team")
:body (fn [events]
(apply str "Hello Team, now the time is" (:timestamp event) "Thank You!"))
:from "xxx@gmail.com"})]
我的输出:
Hello Team, now the time is Thank You!
我的预期输出:
Hello Team, now the time is 12:13:45 Thank You!.
我的时间戳没有附加在 :body 中。
【问题讨论】:
-
您的参数是
events,而您从event读取(缺少s)。先从(pr-str events)开始,看看你会得到什么。 -
我尝试使用
(pr-str events)我得到了事件:timestamp.但是当我尝试使用(apply str "Hello Team, now the time is" (:timestamp events) "Thank You!")).时,我没有得到:timestamp的值被附加到我的字符串中。 -
请将 pr-str 添加到问题中