From 484ac45a8771cd9648e0c3c24beafd5c0b62c1c7 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Wed, 13 Dec 2023 10:01:29 -0500 Subject: [PATCH] credo. --- .../outfront_takeover_tool/alerts/reminders.ex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex b/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex index efe83dbc..18e8ca8f 100644 --- a/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex +++ b/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex @@ -29,17 +29,21 @@ defmodule Screenplay.OutfrontTakeoverTool.Alerts.Reminders do Logger.debug("No outdated alerts found") alerts -> - Enum.each(alerts, fn %Alert{stations: stations} -> - stations - |> format_slack_message() - |> send_slack_message(url) - end) + send_reminders_for_alerts(alerts, url) end end {:noreply, state} end + defp send_reminders_for_alerts(alerts, url) do + Enum.each(alerts, fn %Alert{stations: stations} -> + stations + |> format_slack_message() + |> send_slack_message(url) + end) + end + defp format_slack_message(stations) do group_id = Application.get_env(:screenplay, :pio_slack_group_id)