Shorten daily Slack messages: remove ad evaluations, keep only name+buttons for pauses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Manuel 2026-06-23 18:29:36 +02:00
parent 35d5bec8cc
commit 4d67c25578

View File

@ -75,14 +75,7 @@ def _ad_action_blocks(ads: list) -> list:
if not ad.get("row_id"):
continue
name = ad["name"]
ev = ad.get("evaluacion", "")
rec = ad.get("recomendacion", "")
text = f"⛔ *{name[:55]}*"
if ev:
text += f"\n_{ev}_"
if rec:
text += f"\n{rec}"
text += "\n⚠️ *El anuncio será pausado en Meta Ads si se aprueba*"
text = f"⛔ *{name[:80]}* _(0 leads · 7d)_"
blocks.append({"type": "section", "text": {"type": "mrkdwn", "text": text}})
blocks.append({
"type": "actions",
@ -144,16 +137,6 @@ def _adset_ad_table(items: list, label: str, show_bid: bool = False, show_7d: bo
f"{name:<45} {it['spend']:>5.0f}{leads_str} {cpl_str} {it['ctr']:>4.1f}%"
)
lines.append("```")
# Evaluations below the table
for it in items:
ev = it.get("evaluacion", "")
rec = it.get("recomendacion", "")
if ev or rec:
lines.append(f"• *{it['name'][:55]}*")
if ev:
lines.append(f" _{ev}_")
if rec:
lines.append(f"{rec}")
return "\n".join(lines)