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:
parent
35d5bec8cc
commit
4d67c25578
@ -75,14 +75,7 @@ def _ad_action_blocks(ads: list) -> list:
|
|||||||
if not ad.get("row_id"):
|
if not ad.get("row_id"):
|
||||||
continue
|
continue
|
||||||
name = ad["name"]
|
name = ad["name"]
|
||||||
ev = ad.get("evaluacion", "")
|
text = f"⛔ *{name[:80]}* _(0 leads · 7d)_"
|
||||||
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*"
|
|
||||||
blocks.append({"type": "section", "text": {"type": "mrkdwn", "text": text}})
|
blocks.append({"type": "section", "text": {"type": "mrkdwn", "text": text}})
|
||||||
blocks.append({
|
blocks.append({
|
||||||
"type": "actions",
|
"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}%"
|
f"{name:<45} {it['spend']:>5.0f}€ {leads_str} {cpl_str} {it['ctr']:>4.1f}%"
|
||||||
)
|
)
|
||||||
lines.append("```")
|
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)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user