Change trending notification

This commit is contained in:
Andre Medeiros 2022-05-01 13:04:05 -04:00
parent 2027760e1e
commit 8502a67352

View file

@ -38,7 +38,7 @@ type trendingWorker struct {
watcherRepo domain.WatcherRepository
}
const trendingNotificationTitleFormat = "🔥 Trending in r/%s"
const trendingNotificationTitleFormat = "🔥 r/%s Trending"
func NewTrendingWorker(logger *logrus.Logger, statsd *statsd.Client, db *pgxpool.Pool, redis *redis.Client, queue rmq.Connection, consumers int) Worker {
reddit := reddit.NewClient(
@ -318,10 +318,9 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) {
func payloadFromTrendingPost(post *reddit.Thing) *payload.Payload {
title := fmt.Sprintf(trendingNotificationTitleFormat, post.Subreddit)
payload := payload.
return payload.
NewPayload().
AlertTitle(title).
AlertSubtitle(post.Title).
AlertBody(post.Title).
AlertSummaryArg(post.Subreddit).
Category("post-watch").
@ -332,6 +331,4 @@ func payloadFromTrendingPost(post *reddit.Thing) *payload.Payload {
Custom("post_age", post.CreatedAt).
MutableContent().
Sound("traloop.wav")
return payload
}