influxdata / influxdata/kapacitor

Allow Templating in .email field in SMTP handler.

Open
#2,437 4 comments 1 reaction 0 assignees View on GitHub
new-feature
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Hello, i'm trying tick script

var every = 20s
var period = 5h
var total = batch
|query('select "Mails" from "DB"."RB"."MailsMeasurement" ORDER BY DESC LIMIT 1')
.every(every)
.period(period)
var mail = '{{ index .Fields "Mails" }}'
total
|log()
|alert()
.crit(lambda: TRUE)
.message(mail)
.email(mail)

Where
Mails: Can be array of mails (but for tests i put in field one mail, i know that for arrays i can use '.to()')

When i watch logs of script, i see that message resolves and "event_message=MyMail@ForTest.com" appears, but i recieve nothing.
[smtp] section configured, when i specify mail in TICK like " .email(MyMail@ForTest.com)" i recieve it

What am I missing?

Thanks a lot!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided TICK script with the SMTP section configured, comparing a templated .email value with a literal address. Trace the SMTP handler's handling of the alert email and confirm that a templated address is resolved and delivered; the issue does not name a source file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.