AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(backend): align transactional emails with the design system (#15167)
Toran Bruce Richards2f3905eb6015
diff --git a/autogpt_platform/backend/.env.default b/autogpt_platform/backend/.env.defaultindex 7ba576e516..a599326ba7 100644--- a/autogpt_platform/backend/.env.default+++ b/autogpt_platform/backend/.env.default@@ -246,13 +246,15 @@ POSTMARK_WEBHOOK_TOKEN=# go out on a transactional stream, separate from marketing mail.BILLING_SENDER_EMAIL=AutoGPT <[email protected]>PRODUCT_SENDER_EMAIL=AutoGPT <[email protected]>OPS_SENDER_EMAIL=AutoGPT Platform <[email protected]>POSTMARK_TRANSACTIONAL_STREAM=outbound# Hero art and the logo are hosted images: Outlook does not render inline SVG-# and Gmail does not display data-URI images. Serve backend/notifications/assets-# from this base URL.-EMAIL_ASSET_BASE_URL=https://cdn.agpt.co/email+# and Gmail does not display data-URI images. The logo is served from this+# base URL; Otto uses the versioned character library on the same host.+EMAIL_ASSET_BASE_URL=https://platform.agpt.co/emailDOCS_BASE_URL=https://docs.agpt.coDISCORD_INVITE_URL=https://discord.gg/autogptADMIN_PANEL_BASE_URL=https://admin.agpt.codiff --git a/autogpt_platform/backend/backend/api/features/auth_email/routes.py b/autogpt_platform/backend/backend/api/features/auth_email/routes.pyindex 0b44cbdee4..1375532ec3 100644--- a/autogpt_platform/backend/backend/api/features/auth_email/routes.py+++ b/autogpt_platform/backend/backend/api/features/auth_email/routes.py@@ -13,16 +13,15 @@ to our own hosts."""import asyncio-import htmlimport loggingimport re-from typing import Literalfrom urllib.parse import urlparsefrom autogpt_libs.auth import requires_frontend_servicefrom fastapi import APIRouter, HTTPException, Security, statusfrom pydantic import BaseModel, EmailStr+from backend.notifications.auth import AuthEmailType, render_auth_emailfrom backend.util.clients import get_notification_manager_clientfrom backend.util.settings import Settings@@ -34,21 +33,9 @@ auth_email_router = APIRouter()# Module-level so tests can override the exact dependency instance.requires_auth_email_service = requires_frontend_service("auth-email:send")-_SUBJECTS: dict[str, str] = {- "reset_password": "Reset your AutoGPT Platform password",- "verify_email": "Verify your AutoGPT Platform email",- "change_email": "Confirm your new AutoGPT Platform email",-}--_ACTIONS: dict[str, str] = {- "reset_password": "reset your password",- "verify_email": "verify your email",- "change_email": "confirm your new email address",-}-class AuthEmailRequest(BaseModel):- type: Literal["reset_password", "verify_email", "change_email"]+ type: AuthEmailTypeto: EmailStrurl: str@@ -76,16 +63,7 @@ async def send_auth_email(request: AuthEmailRequest) -> None:detail="url must point at a trusted frontend origin.",)- subject = _SUBJECTS[request.type]- action = _ACTIONS[request.type]- # Escape the (host-validated) URL before embedding it in HTML — a path or- # query on an allowed host could still carry markup-breaking characters.- safe_url = html.escape(request.url, quote=True)- body = (- f"<p>Click the link below to {action} for the AutoGPT Platform:</p>"- f'<p><a href="{safe_url}">{safe_url}</a></p>'- "<p>If you didn't request this, you can safely ignore this email.</p>"- )+ email = render_auth_email(request.type, request.url)# The blocking RPC to the notification service runs off the event loop; a# delivery failure there surfaces as a 5xx so a misconfigured mailer fails@@ -93,8 +71,9 @@ async def send_auth_email(request: AuthEmailRequest) -> None:await asyncio.to_thread(get_notification_manager_client().send_email_or_raise,request.to,- subject,- body,+ email.subject,+ email.html,+ email.text,)# Don't log the recipient address — auth emails go to arbitrary users and# the address is PII we don't want in application logs.diff --git a/autogpt_platform/backend/backend/api/features/auth_email/routes_test.py b/autogpt_platform/backend/backend/api/features/auth_email/routes_test.pyindex 37959a063c..71866bd2f1 100644--- a/autogpt_platform/backend/backend/api/features/auth_email/routes_test.py+++ b/autogpt_platform/backend/backend/api/features/auth_email/routes_test.py@@ -1,4 +1,6 @@import os+import re+from html import unescapefrom unittest.mock import MagicMockimport fastapi@@ -57,10 +59,11 @@ def test_valid_request_sends_and_returns_204(send_mock):res = _post()assert res.status_code == 204send_mock.assert_called_once()- to, subject, body = send_mock.call_args.args+ to, subject, body, text = send_mock.call_args.argsassert to == "[email protected]"assert "Reset your AutoGPT Platform password" == subjectassert VALID_BODY["url"] in body+ assert VALID_BODY["url"] in textdef test_rejects_link_on_untrusted_host(send_mock):@@ -208,3 +211,55 @@ def test_rejects_malformed_trusted_origin_regex_at_startup():with pytest.raises(ValueError, match="cannot be empty"):Config(trusted_frontend_origins=["regex:"])+++ "email_type,subject,button",+ [+ ("reset_password", "Reset your AutoGPT Platform password", "Reset password"),+ ("verify_email", "Verify your AutoGPT Platform email", "Verify email"),+ ("change_email", "Confirm your new AutoGPT Platform email", "Confirm email"),+ ],+)+def test_auth_email_design_and_plain_text(send_mock, email_type, subject, button):+ url = 'https://platform.agpt.co/verify?token=a&callback="<script>alert(1)</script>'+ result = _post({**VALID_BODY, "type": email_type, "url": url})+ assert result.status_code == 204+ to, actual_subject, body, text = send_mock.call_args.args+ assert to == VALID_BODY["to"]+ assert actual_subject == subject+ assert body.count('bgcolor="#6144DF"') == 1+ assert 'width="560"' in body+ assert "font-family:Geist," in body+ assert 'alt="AutoGPT"' in body+ assert 'width="100" height="45"' in body+ assert all(+ 'role="presentation"' in table and 'bgcolor="' in table+ for table in re.findall(r"<table\b[^>]*>", body)+ )+ assert all(+ src.startswith("https://")+ for src in re.findall(r'<img[^>]+src="([^"]+)"', body)+ )+ assert "<svg" not in body and "data:image" not in body+ assert "logo-light.png" in body+ assert "Otto, your personal Head of AI" not in body+ assert "autogpt-characters/" not in body+ assert "<script>" not in body+ assert "&callback="<script>" in body+ assert url in text+ assert [unescape(href) for href in re.findall(r'href="([^"]+)"', body)].count(+ url+ ) == 2+ assert all(+ "—" not in part and "–" not in part for part in (actual_subject, body, text)+ )+ assert button in body and button in text+ assert "3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK" in body+ assert "3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK" in text+ assert "This is a service message about an AutoGPT account." in body+ assert "This is a service message about an AutoGPT account." in text+ assert "Unsubscribe" not in body+ assert "Email preferences" not in body+ assert "didn't request this" in text+ assert len(body.encode()) < 60_000diff --git a/autogpt_platform/backend/backend/api/features/store/db.py b/autogpt_platform/backend/backend/api/features/store/db.pyindex 2ed3eb9692..69de921c10 100644--- a/autogpt_platform/backend/backend/api/features/store/db.py+++ b/autogpt_platform/backend/backend/api/features/store/db.py@@ -1890,7 +1890,7 @@ async def _send_submission_review_notification(reviewer_name = reviewer.name if reviewer and reviewer.name else DEFAULT_ADMIN_NAMEreviewed_at = reviewed_listing_version.reviewedAt or datetime.now(tz=timezone.utc)- reviewed_at_label = f"{reviewed_at.day} {reviewed_at.strftime('%B')}"+ reviewed_at_label = f"{reviewed_at.day} {reviewed_at.strftime('%b %Y')}"if is_approved:store_agent = await prisma.models.StoreAgent.prisma().find_first_or_raise(diff --git a/autogpt_platform/backend/backend/data/credit.py b/autogpt_platform/backend/backend/data/credit.pyindex d0de36dcad..071be626d9 100644--- a/autogpt_platform/backend/backend/data/credit.py+++ b/autogpt_platform/backend/backend/data/credit.py@@ -765,7 +765,7 @@ class UserCredit(UserCreditBase):what the person on call triages by, and every timestamp is absolute —the email is read hours later."""now = datetime.now(tz=timezone.utc)- stamp = f"{now.day} {now.strftime('%B')} at {now.strftime('%H:%M')}"+ stamp = f"{now.day} {now.strftime('%b %Y')} at {now.strftime('%H:%M')} UTC"await queue_notification_async(NotificationEventModel[OpsData](user_id=user.id,diff --git a/autogpt_platform/backend/backend/data/notifications.py b/autogpt_platform/backend/backend/data/notifications.pyindex b9c0faa1c5..dd01148fb8 100644--- a/autogpt_platform/backend/backend/data/notifications.py+++ b/autogpt_platform/backend/backend/data/notifications.py@@ -194,7 +194,7 @@ class SubscriptionPlan(BaseModel):name: str = Field(description='"Pro" / "Max"')cycle: Literal["monthly", "yearly"]cycle_noun: Literal["month", "year"]- label: str = Field(description='"Pro — monthly"')+ label: str = Field(description='"Pro · monthly"')price_display: str = Field(description='"$50.00 / month"')@@ -213,6 +213,7 @@ class LifecycleData(BaseNotificationData):class SubscriptionWelcomeData(LifecycleData):renews_label: str+ experts_enabled: bool = Falseclass PaymentFailedData(LifecycleData):diff --git a/autogpt_platform/backend/backend/executor/billing_test.py b/autogpt_platform/backend/backend/executor/billing_test.pyindex 44ab922db8..30f10eb328 100644--- a/autogpt_platform/backend/backend/executor/billing_test.py+++ b/autogpt_platform/backend/backend/executor/billing_test.py@@ -37,5 +37,5 @@ def test_no_spend_history_means_no_invented_date():assert cause.days_left is Noneassert cause.runs_out_label is Noneassert cause.headline == "Your credits are running low"- assert "2 scheduled agents would stop" in cause.body+ assert "2 scheduled workflows would stop" in cause.bodyassert cause.tag == "low balance"diff --git a/autogpt_platform/backend/backend/notifications/alert_causes.py b/autogpt_platform/backend/backend/notifications/alert_causes.pyindex d62d2cd0a4..8247e945b1 100644--- a/autogpt_platform/backend/backend/notifications/alert_causes.py+++ b/autogpt_platform/backend/backend/notifications/alert_causes.py@@ -47,6 +47,10 @@ class BaseCause(BaseModel, Generic[AlertCauseT]):def subject_line(self) -> str:return self.headline+ @property+ def preheader(self) -> str:+ return self.body+@propertydef headline(self) -> str:raise NotImplementedError@@ -111,7 +115,14 @@ class AuthExpiredCause(BaseCause[Literal[AlertCause.AUTH_EXPIRED]]):@propertydef subject_line(self) -> str:- return f"{self.agent} is stuck — {self.provider} needs a reconnect"+ return f"{self.agent} is stuck: {self.provider} needs a reconnect"++ @property+ def preheader(self) -> str:+ return (+ f"{self.provider}’s connection expired at {self.expired_at_label}, so "+ f"{self.agent} can’t run."+ )@propertydef body(self) -> str:@@ -121,8 +132,7 @@ class AuthExpiredCause(BaseCause[Literal[AlertCause.AUTH_EXPIRED]]):else f"{self.runs_skipped} scheduled runs have")return (- f"{self.provider}’s connection expired at {self.expired_at_label}, so "- f"{self.agent} can’t run. {runs} been skipped; the next try is at "+ f"{self.preheader} {runs} been skipped; the next try is at "f"{self.next_try_label}. Until then, its schedule is on hold.")@@ -154,12 +164,16 @@ class PausedFailuresCause(BaseCause[Literal[AlertCause.PAUSED_FAILURES]]):return f"{self.agent} paused itself"@property- def body(self) -> str:+ def preheader(self) -> str:return (f"The step “{self.step}” failed on {self.consecutive_failures} "- "consecutive runs. It stays paused until you take a look."+ "consecutive runs.")+ @property+ def body(self) -> str:+ return f"{self.preheader} It stays paused until you take a look."+@propertydef cta_label(self) -> str:return "See the failing step"@@ -184,11 +198,15 @@ class BlockFailedCause(BaseCause[Literal[AlertCause.BLOCK_FAILED]]):def headline(self) -> str:return f"{self.agent} keeps failing on one step"+ @property+ def preheader(self) -> str:+ return f"Every run gets as far as “{self.step}” and stops there."+@propertydef body(self) -> str:return (- f"Every run gets as far as “{self.step}” and stops there. The rest of "- f"{self.agent} is fine — this one step needs a look."+ f"{self.preheader} The rest of {self.agent} is fine: "+ "this one step needs a look.")@property@@ -271,12 +289,13 @@ class AwaitingReviewCause(BaseCause[Literal[AlertCause.AWAITING_REVIEW]]):return f"{self.agent} is waiting on your review"@property- def body(self) -> str:+ def preheader(self) -> str:output = "1 output" if self.count == 1 else f"{self.count} outputs"- return (- f"{output} waiting since {self.since_label}. Nothing sends until you "- "approve or dismiss."- )+ return f"{output} waiting since {self.since_label}."++ @property+ def body(self) -> str:+ return f"{self.preheader} Nothing sends until you approve or dismiss."@propertydef cta_label(self) -> str:@@ -340,21 +359,27 @@ class LowBalanceCause(BaseCause[Literal[AlertCause.LOW_BALANCE]]):day_word = "day" if self.days_left == 1 else "days"return f"Your credits run out in about {self.days_left} {day_word}"+ @property+ def preheader(self) -> str:+ if self.days_left is None:+ return f"{self.balance_display} remaining."+ return (+ f"At {self.daily_rate_display}/day the {self.balance_display} remaining "+ f"run out around {self.runs_out_label}."+ )+@propertydef body(self) -> str:agents = (- "1 scheduled agent would stop"+ "1 scheduled workflow would stop"if self.scheduled_agents == 1- else f"{self.scheduled_agents} scheduled agents would stop"+ else f"{self.scheduled_agents} scheduled workflows would stop")if self.days_left is None:# No usable spend history: state the balance and the stake, and# stop short of a date we cannot stand behind.- return f"{self.balance_display} remaining. {agents} when it runs out."- return (- f"At {self.daily_rate_display}/day the {self.balance_display} remaining "- f"run out around {self.runs_out_label}. {agents}."- )+ return f"{self.preheader} {agents} when it runs out."+ return f"{self.preheader} {agents}."@propertydef cta_label(self) -> str:@@ -379,14 +404,15 @@ class ZeroBalanceCause(BaseCause[Literal[AlertCause.ZERO_BALANCE]]):@propertydef headline(self) -> str:- return f"{self.agent} stopped — you are out of credits"+ return f"{self.agent} stopped: you are out of credits"++ @property+ def preheader(self) -> str:+ return f"{self.agent} needs {self.shortfall_display} more credits to finish."@propertydef body(self) -> str:- return (- f"{self.agent} needs {self.shortfall_display} more credits to finish. It "- "stays stopped until you top up."- )+ return f"{self.preheader} It stays stopped until you top up."@propertydef cta_label(self) -> str:@@ -413,12 +439,16 @@ class GuardrailCause(BaseCause[Literal[AlertCause.GUARDRAIL]]):return f"{self.agent} hit its spend limit"@property- def body(self) -> str:+ def preheader(self) -> str:return (f"Reached its {self.limit_display}-credit limit for this "- f"{self.period_noun} and stopped mid-run. Resumes {self.reset_label}."+ f"{self.period_noun} and stopped mid-run.")+ @property+ def body(self) -> str:+ return f"{self.preheader} Resumes {self.reset_label}."+@propertydef cta_label(self) -> str:return "Review spend limit"diff --git a/autogpt_platform/backend/backend/notifications/alerts.py b/autogpt_platform/backend/backend/notifications/alerts.pyindex ee9fcd7c24..a6c9771227 100644--- a/autogpt_platform/backend/backend/notifications/alerts.py+++ b/autogpt_platform/backend/backend/notifications/alerts.py@@ -122,7 +122,7 @@ async def build_alert_email(user_id: str, alerts_enabled: bool) -> BuiltAlert |primary=AlertPrimary(headline=primary.headline,subject=primary.subject_line,- preheader=primary.body,+ preheader=primary.preheader,body=primary.body,cta_label=primary.cta_label,cta_url=f"{base_url}{primary.cta_path}",@@ -157,6 +157,4 @@ def _timestamp_label() -> str:"""Absolute, never a duration: the email is read hours later, and a stalerelative time is a wrong time."""now = datetime.now(tz=timezone.utc)- return (- f"{now.strftime('%a')} {now.day} {now.strftime('%b')}, {now.strftime('%H:%M')}"- )+ return f"{now.day} {now.strftime('%b %Y')}, {now.strftime('%H:%M')} UTC"diff --git a/autogpt_platform/backend/backend/notifications/alerts_test.py b/autogpt_platform/backend/backend/notifications/alerts_test.pyindex 4d81707c3a..2ca787ba43 100644--- a/autogpt_platform/backend/backend/notifications/alerts_test.py+++ b/autogpt_platform/backend/backend/notifications/alerts_test.py@@ -97,9 +97,10 @@ async def test_the_cta_verb_is_the_fix_not_view_dashboard():assert built is not Noneassert built.data.primary.cta_label == "Reconnect Gmail"+ assert built.data.primary.preheader == AUTH.preheader+ assert "2 scheduled runs have been skipped" in built.data.primary.bodyassert (- built.data.primary.subject- == "Invoice Chaser is stuck — Gmail needs a reconnect"+ built.data.primary.subject == "Invoice Chaser is stuck: Gmail needs a reconnect")@@ -169,3 +170,18 @@ def test_the_debounce_and_dedupe_windows_match_the_design():assert ALERT_DEBOUNCE == timedelta(minutes=10)assert ALERT_DEDUPE_WINDOW == timedelta(hours=24)assert MAX_ALERT_EMAILS_PER_DAY == 2+++def test_alert_copy_names_workflows_and_uses_plain_punctuation():+ assert AUTH.subject_line == "Invoice Chaser is stuck: Gmail needs a reconnect"+ assert "4 scheduled workflows would stop" in LOW.body+ for cause in (AUTH, LOW, ZERO):+ assert "—" not in cause.subject_line+ assert "—" not in cause.body+ assert "–" not in cause.body+++def test_alert_copy_preserves_customer_workflow_names():+ cause = AUTH.model_copy(update={"agent": "Invoices — EU"})+ assert cause.subject_line == "Invoices — EU is stuck: Gmail needs a reconnect"+ assert "Invoices — EU" in cause.bodydiff --git a/autogpt_platform/backend/backend/notifications/auth.py b/autogpt_platform/backend/backend/notifications/auth.pynew file mode 100644index 0000000000..80f20f39eb--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/auth.py@@ -0,0 +1,71 @@+"""Render the fixed Better Auth messages through the shared service-email kit."""++from typing import Literal++from pydantic import BaseModel++from backend.notifications.renderer import RenderedEmail, build_urls+from backend.notifications.template_env import create_body_environment+from backend.util.settings import Settings++AuthEmailType = Literal["reset_password", "verify_email", "change_email"]+settings = Settings()+_html_env = create_body_environment(autoescape=True)+_text_env = create_body_environment(autoescape=False)+++class AuthEmailContent(BaseModel):+ subject: str+ eyebrow: str+ headline: str+ intro: str+ preheader: str+ action: str+ reason: str+++def render_auth_email(email_type: AuthEmailType, action_url: str) -> RenderedEmail:+ content = _CONTENT[email_type]+ context = {+ "content": content,+ "action_url": action_url,+ "assets": settings.config.email_asset_base_url.rstrip("/"),+ "urls": build_urls(""),+ }+ return RenderedEmail(+ subject=content.subject,+ preheader=content.preheader,+ html=_html_env.get_template("auth.html.j2").render(**context),+ text=_text_env.get_template("auth.txt.j2").render(**context).strip(),+ )+++_CONTENT: dict[AuthEmailType, AuthEmailContent] = {+ "reset_password": AuthEmailContent(+ subject="Reset your AutoGPT Platform password",+ eyebrow="ACCOUNT · RESET PASSWORD",+ headline="Reset your password",+ intro="A password reset was requested for your AutoGPT account.",+ preheader="Use the button below to choose a new password.",+ action="Reset password",+ reason="This link was requested from the AutoGPT password-reset form.",+ ),+ "verify_email": AuthEmailContent(+ subject="Verify your AutoGPT Platform email",+ eyebrow="ACCOUNT · VERIFY EMAIL",+ headline="Confirm your email address",+ intro="Confirm this address for your AutoGPT account.",+ preheader="Use the button below to verify your email.",+ action="Verify email",+ reason="This link was requested from the AutoGPT sign-up form.",+ ),+ "change_email": AuthEmailContent(+ subject="Confirm your new AutoGPT Platform email",+ eyebrow="ACCOUNT · CONFIRM EMAIL",+ headline="Confirm your new email address",+ intro="An email address change was requested for your AutoGPT account.",+ preheader="Use the button below to confirm your new email address.",+ action="Confirm email",+ reason="This link was requested from your AutoGPT account settings.",+ ),+}diff --git a/autogpt_platform/backend/backend/notifications/briefing.py b/autogpt_platform/backend/backend/notifications/briefing.pyindex f93bfb2562..6ac4040df4 100644--- a/autogpt_platform/backend/backend/notifications/briefing.py+++ b/autogpt_platform/backend/backend/notifications/briefing.py@@ -231,7 +231,7 @@ def _standout(agents: list[AgentPeriodStats], totals: BriefingTotals) -> str | Nbusiest = max(agents, key=lambda a: a.runs)if busiest.runs * 2 >= totals.runs:return (- f"{busiest.agent} did most of the work — {busiest.runs:,} of "+ f"{busiest.agent} did most of the work: {busiest.runs:,} of "f"{totals.runs:,} runs.")diff --git a/autogpt_platform/backend/backend/notifications/briefing_period.py b/autogpt_platform/backend/backend/notifications/briefing_period.pyindex d6e95970bf..d5bfdcc710 100644--- a/autogpt_platform/backend/backend/notifications/briefing_period.py+++ b/autogpt_platform/backend/backend/notifications/briefing_period.py@@ -96,7 +96,7 @@ def period_window(else:start_date, end_date = today - timedelta(days=7), todaylabel = (- f"{_format_day(start_date)} – {_format_day(end_date - timedelta(days=1))}"+ f"{_format_day(start_date)} to {_format_day(end_date - timedelta(days=1))}")noun = "last week"@@ -118,4 +118,4 @@ def _utc_midnight(day: date, zone: ZoneInfo) -> datetime:def _format_day(day: date) -> str:- return f"{day.strftime('%a')} {day.day} {day.strftime('%b')}"+ return f"{day.strftime('%a')} {day.day} {day.strftime('%b %Y')}"diff --git a/autogpt_platform/backend/backend/notifications/design_system_fixtures.py b/autogpt_platform/backend/backend/notifications/design_system_fixtures.pynew file mode 100644index 0000000000..a2db990f99--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/design_system_fixtures.py@@ -0,0 +1,345 @@+"""Public-safe scenarios for the transactional email design checks and previews."""++from prisma.enums import NotificationType+from pydantic import BaseModel++from backend.data.notifications import (+ AlertAlsoItem,+ AlertData,+ AlertFact,+ AlertPrimary,+ BaseNotificationData,+ BriefingAttentionItem,+ BriefingData,+ BriefingHighlight,+ BriefingLedgerRow,+ BriefingPeriod,+ BriefingTotals,+ CardDetails,+ OpsData,+ PaymentFailedData,+ PaymentFinalNoticeData,+ SubscriptionCancelledData,+ SubscriptionEndedData,+ SubscriptionPlan,+ SubscriptionResumedData,+ SubscriptionWelcomeData,+ TrialUpdateData,+ VerdictData,+)+from backend.notifications.renderer import EmailUrls++URLS = EmailUrls(+ chat="https://platform.example/copilot",+ dashboard="https://platform.example/library",+ settings="https://platform.example/settings/account",+ unsubscribe="https://platform.example/unsubscribe?token=example-token",+ attention="https://platform.example/library?filter=needs-attention",+ billing="https://platform.example/settings/billing",+ prefs="https://platform.example/settings/account",+ marketplace="https://platform.example/marketplace",+ docs="https://docs.example",+ discord="https://discord.example/autogpt",+ volume={+ choice: f"https://platform.example/preferences?token=example-{choice}"+ for choice in ("daily", "weekly", "monthly", "alerts", "off")+ },+)+PLAN = SubscriptionPlan(+ name="Max",+ cycle="monthly",+ cycle_noun="month",+ label="Max · monthly",+ price_display="$50.00 / month",+)+++class EmailScenario(BaseModel):+ name: str+ notification_type: NotificationType+ data: BaseNotificationData+++def scenarios() -> list[EmailScenario]:+ return [+ *_lifecycle(),+ *_trials(),+ *_briefings(),+ *_alerts(),+ *_verdicts(),+ *_ops(),+ EmailScenario(+ name="welcome-experts-enabled",+ notification_type=NotificationType.SUBSCRIPTION_WELCOME,+ data=SubscriptionWelcomeData(+ user_name="Sam",+ plan=PLAN,+ renews_label="3 Nov 2026",+ experts_enabled=True,+ ),+ ),+ ]+++def _lifecycle() -> list[EmailScenario]:+ common = {"user_name": "Sam", "plan": PLAN}+ rows = [+ (+ NotificationType.SUBSCRIPTION_WELCOME,+ SubscriptionWelcomeData(**common, renews_label="3 Nov 2026"),+ ),+ (+ NotificationType.PAYMENT_FAILED,+ PaymentFailedData(+ **common,+ amount_display="$50.00",+ next_retry_label="7 Oct 2026",+ card=CardDetails(brand="Visa", last4="4242"),+ ),+ ),+ (+ NotificationType.PAYMENT_FINAL_NOTICE,+ PaymentFinalNoticeData(+ **common, amount_display="$50.00", pauses_label="10 Oct 2026"+ ),+ ),+ (+ NotificationType.SUBSCRIPTION_CANCELLED,+ SubscriptionCancelledData(**common, access_until_label="3 Nov 2026"),+ ),+ (+ NotificationType.SUBSCRIPTION_RESUMED,+ SubscriptionResumedData(**common, renews_label="3 Nov 2026"),+ ),+ ]+ return [+ EmailScenario(name=str(kind).lower(), notification_type=kind, data=data)+ for kind, data in rows+ ] + [+ EmailScenario(+ name=f"ended-payment-{payment}",+ notification_type=NotificationType.SUBSCRIPTION_ENDED,+ data=SubscriptionEndedData(+ **common, ended_label="3 Oct 2026", due_to_payment=payment+ ),+ )+ for payment in (True, False)+ ]+++def _trials() -> list[EmailScenario]:+ return [+ EmailScenario(+ name=f"trial-{kind}",+ notification_type=NotificationType.TRIAL_UPDATE,+ data=TrialUpdateData(+ user_name="Sam",+ plan=PLAN,+ kind=kind,+ ends_label="10 Oct 2026",+ onboarding_credit_amount=300,+ offer_version="example-offer",+ ),+ )+ for kind in (+ "started",+ "ending",+ "canceled",+ "resumed",+ "ended",+ "converted",+ "payment_failed",+ )+ ]+++def _briefings() -> list[EmailScenario]:+ base = BriefingData(+ period=BriefingPeriod(+ label="26 Sep to 2 Oct 2026",+ noun="this week",+ adjective="week",+ frequency="weekly",+ ),+ totals=BriefingTotals(+ runs=42, agents_active=2, credits_used=4.2, credits_balance=295.8+ ),+ ledger=[+ BriefingLedgerRow(agent="Lead Scout", runs=21, credits=2.1),+ BriefingLedgerRow(agent="Invoice Follow-up", runs=21, credits=2.1),+ ],+ highlights=[+ BriefingHighlight(+ agent="Lead Scout",+ gist="found five prospects.",+ link_label="See the prospects",+ url="https://platform.example/library/run-1",+ )+ ],+ )+ attention = [+ BriefingAttentionItem(+ agent=f"Workflow {i}",+ title=f"Workflow {i} needs a connection",+ tag="CONNECTION",+ body="Reconnect the account to continue.",+ cta_label="Reconnect account",+ cta_url=f"https://platform.example/integrations/{i}",+ )+ for i in range(4)+ ]+ variants = {+ "weekly": base,+ "daily": base.model_copy(+ update={+ "period": BriefingPeriod(+ label="2 Oct 2026",+ noun="yesterday",+ adjective="day",+ frequency="daily",+ )+ }+ ),+ "monthly": base.model_copy(+ update={+ "period": BriefingPeriod(+ label="September 2026",+ noun="in September",+ adjective="month",+ frequency="monthly",+ )+ }+ ),+ "quiet": base.model_copy(+ update={+ "mode": "quiet",+ "only_agent": "Lead Scout",+ "quiet_summary": "The scheduled work is complete.",+ }+ ),+ "attention-overflow": base.model_copy(+ update={+ "attention": attention,+ "ledger_overflow": 8,+ "ledger_overflow_runs": 16,+ "ledger_overflow_issues": 2,+ }+ ),+ "rough": base.model_copy(+ update={+ "totals": base.totals.model_copy(update={"failed": 20}),+ "ledger": [+ BriefingLedgerRow(+ agent="Lead Scout",+ runs=42,+ credits=4.2,+ issues_label="20 failed",+ issues_kind="fail",+ )+ ],+ }+ ),+ }+ return [+ EmailScenario(+ name=f"briefing-{name}",+ notification_type=NotificationType.BRIEFING,+ data=data,+ )+ for name, data in variants.items()+ ]+++def _alerts() -> list[EmailScenario]:+ base = AlertData(+ timestamp_label="3 Oct 2026 at 09:26 UTC",+ primary=AlertPrimary(+ headline="Invoice Follow-up is paused",+ body="Gmail needs a new connection.",+ subject="Invoice Follow-up needs Gmail reconnected",+ preheader="Reconnect Gmail to continue your scheduled work.",+ cta_label="Reconnect Gmail",+ cta_url="https://platform.example/integrations/gmail",+ facts=[AlertFact(label="Skipped runs", value="2")],+ microcopy="Scheduled runs resume after you reconnect.",+ ),+ )+ return [+ EmailScenario(+ name=f"alert-{count}",+ notification_type=NotificationType.ALERT,+ data=base.model_copy(+ update={+ "also": [+ AlertAlsoItem(+ agent=f"Workflow {i}",+ text="has an output waiting",+ link_label="Review output",+ url=f"https://platform.example/library/review-{i}",+ )+ for i in range(count)+ ]+ }+ ),+ )+ for count in (0, 3)+ ]+++def _verdicts() -> list[EmailScenario]:+ base = VerdictData(+ outcome="approved",+ agent_name="Lead Scout",+ version=3,+ reviewer_name="Alex",+ reviewed_at_label="3 Oct 2026",+ comments="Ready to share.",+ store_url="https://platform.example/marketplace/lead-scout",+ share_url="https://platform.example/marketplace/lead-scout",+ resubmit_url="https://platform.example/library/lead-scout/edit",+ )+ variants = {+ "approved": base,+ "changes": base.model_copy(+ update={+ "outcome": "changes",+ "changes": ["Clarify the inputs.", "Add a sample output."],+ }+ ),+ "no-feedback": base.model_copy(update={"outcome": "changes", "comments": " "}),+ }+ return [+ EmailScenario(+ name=f"verdict-{name}",+ notification_type=NotificationType.VERDICT,+ data=data,+ )+ for name, data in variants.items()+ ]+++def _ops() -> list[EmailScenario]:+ return [+ EmailScenario(+ name=f"ops-{kind}",+ notification_type=NotificationType.OPS,+ data=OpsData(+ kind=kind,+ user_name="Sam",+ user_email="[email protected]",+ user_id="example-user",+ transaction_id="example-transaction",+ refund_request_id="example-request",+ amount_cents=1200,+ balance_cents=5000,+ reason="The workflow did not produce the expected output.",+ recipient="[email protected]",+ stripe_url="https://stripe.example/payment",+ admin_url="https://admin.example/refund",+ age_label="3 Oct 2026 at 09:26 UTC",+ requested_at_label="3 Oct 2026 at 09:26 UTC",+ processed_at_label="3 Oct 2026 at 10:26 UTC",+ ),+ )+ for kind in ("request", "processed")+ ]diff --git a/autogpt_platform/backend/backend/notifications/design_system_test.py b/autogpt_platform/backend/backend/notifications/design_system_test.pynew file mode 100644index 0000000000..05ce9ecc57--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/design_system_test.py@@ -0,0 +1,206 @@+"""Edition 1 design contracts across the complete transactional inventory."""++import re+from html.parser import HTMLParser+from typing import get_args++import pytest+from prisma.enums import NotificationType++from backend.data.notifications import (+ DeliveryStream,+ TrialUpdateData,+ VerdictData,+ get_delivery_stream,+)+from backend.notifications.design_system_fixtures import URLS, EmailScenario, scenarios+from backend.notifications.renderer import RenderedEmail, render++SCENARIOS = scenarios()+OTTO_PATH = "/autogpt-characters/v1.1/otto/neutral/256.png"+ADDRESS = "3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK"++[email protected](params=SCENARIOS, ids=lambda scenario: scenario.name)+def rendered(request) -> tuple[EmailScenario, RenderedEmail, "EmailDocument"]:+ scenario = request.param+ email = render(scenario.notification_type, scenario.data, "[email protected]", URLS)+ document = EmailDocument()+ document.feed(email.html)+ return scenario, email, document+++def test_every_transactional_variant_uses_the_shared_frame(rendered):+ _, email, document = rendered+ assert email.html.startswith("<!doctype html>")+ assert len(email.html.encode("utf-8")) < 60 * 1024+ assert email.preheader and email.text+ assert "Geist," in document.elements("body")[0]["style"]+ assert "Geist+Mono" in email.html+ assert any(table.get("width") == "560" for table in document.elements("table"))+ for table in document.elements("table"):+ assert table.get("role") == "presentation"+ assert table.get("bgcolor"), table+ assert ADDRESS in document.text+ assert "<svg" not in email.html.lower()+ assert "data:image" not in email.html.lower()+ assert "Poppins" not in email.html+++def test_masthead_and_otto_survive_email_image_restrictions(rendered):+ scenario, _, document = rendered+ images = document.elements("img")+ assert len(images) == 2+ logo, otto = images+ assert logo["src"].endswith("/email/logo-light.png")+ assert (logo["width"], logo["height"], logo["alt"]) == ("100", "45", "AutoGPT")+ assert otto["src"].endswith(OTTO_PATH)+ size = "80" if scenario.notification_type == NotificationType.OPS else "160"+ assert (otto["width"], otto["height"]) == (size, size)+ assert otto["alt"] == "Otto, your personal Head of AI"+ for image in images:+ assert image["src"].startswith("https://")+ assert re.search(r"\.(png|jpe?g)$", image["src"], re.I)+ assert any(link == "https://agpt.co" for link in document.links)+ assert document.text.strip()+++def test_authored_copy_uses_workflow_vocabulary_and_plain_punctuation(rendered):+ _, email, document = rendered+ for part in (email.subject, email.preheader, document.text, email.text):+ assert "—" not in part+ assert "–" not in part+ assert not re.search(r"\bagents?\b", part, re.I)+ for banned in ("Summary", "Report", "Newsletter"):+ assert banned not in email.subject+++def test_button_counts_follow_explicit_family_exceptions(rendered):+ scenario, _, document = rendered+ buttons = [+ element+ for element in document.elements("td")+ if element.get("bgcolor", "").upper() == "#6144DF"+ ]+ if scenario.notification_type == NotificationType.SUBSCRIPTION_CANCELLED:+ assert not buttons+ assert URLS.billing in document.links+ elif scenario.notification_type == NotificationType.BRIEFING:+ assert len(buttons) <= 1+ if scenario.name == "briefing-attention-overflow":+ assert len(buttons) == 1+ else:+ assert len(buttons) == 1+++def test_footers_match_the_delivery_stream(rendered):+ scenario, email, document = rendered+ stream = get_delivery_stream(scenario.notification_type)+ if stream == DeliveryStream.PRODUCT:+ assert URLS.unsubscribe in document.links+ assert URLS.unsubscribe in email.text+ assert URLS.discord in document.links+ assert URLS.discord in email.text+ elif stream == DeliveryStream.BILLING:+ assert "service message" in document.text+ assert URLS.prefs in document.links+ assert URLS.prefs in email.text+ assert URLS.unsubscribe not in document.links+ assert URLS.unsubscribe not in email.text+ else:+ assert "Not customer-facing" in document.text+ assert URLS.unsubscribe not in document.links+ assert URLS.discord not in document.links+++ "scenario",+ [s for s in SCENARIOS if s.notification_type == NotificationType.BRIEFING],+ ids=lambda scenario: scenario.name,+)+def test_briefing_preserves_signed_cadence_links(scenario):+ email = render(scenario.notification_type, scenario.data, "[email protected]", URLS)+ current = scenario.data.model_dump()["period"]["frequency"]+ for choice, url in URLS.volume.items():+ if choice != current:+ assert url in email.html+ assert url in email.text+ assert re.search(+ r"<(?:strong|span)[^>]*font-weight:700[^>]*>"+ + current.capitalize()+ + r"</(?:strong|span)>",+ email.html,+ )+ assert "?f=" not in email.html+ for label in ("Daily", "Weekly", "Monthly", "Alerts only", "Pause"):+ assert label in email.html+++def test_reviewer_feedback_is_complete_and_inert():+ feedback = '<script>alert("example")</script> Keep the user’s dash — unchanged.'+ data = VerdictData(+ outcome="changes",+ agent_name="Example <workflow>",+ version=1,+ reviewer_name="Alex",+ reviewed_at_label="3 Oct 2026",+ comments=feedback,+ resubmit_url="https://platform.example/edit",+ )+ email = render(NotificationType.VERDICT, data, "[email protected]", URLS)+ document = EmailDocument()+ document.feed(email.html)+ assert not document.elements("script")+ assert feedback in document.text+ assert feedback in email.text+ assert "Example <workflow>" in document.text+++def test_ops_keeps_customer_email_distinct_from_internal_recipient():+ scenario = next(s for s in SCENARIOS if s.name == "ops-request")+ email = render(+ scenario.notification_type, scenario.data, "[email protected]", URLS+ )+ assert "[email protected]" in email.html+ assert "[email protected]" in email.text+++def test_scenarios_cover_every_notification_type_and_trial_state():+ assert {s.notification_type for s in SCENARIOS} == set(NotificationType)+ assert {+ s.name.removeprefix("trial-")+ for s in SCENARIOS+ if s.notification_type == NotificationType.TRIAL_UPDATE+ } == set(get_args(TrialUpdateData.model_fields["kind"].annotation))+++class EmailDocument(HTMLParser):+ def __init__(self):+ super().__init__(convert_charrefs=True)+ self.tags: list[tuple[str, dict[str, str]]] = []+ self._text: list[str] = []+ self._ignored: list[str] = []++ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]):+ self.tags.append((tag, {key: value or "" for key, value in attrs}))+ if tag in ("head", "style", "script"):+ self._ignored.append(tag)++ def handle_endtag(self, tag: str):+ if self._ignored and self._ignored[-1] == tag:+ self._ignored.pop()++ def handle_data(self, data: str):+ if not self._ignored:+ self._text.append(data)++ def elements(self, tag: str) -> list[dict[str, str]]:+ return [attributes for name, attributes in self.tags if name == tag]++ @property+ def text(self) -> str:+ return " ".join(" ".join(self._text).split())++ @property+ def links(self) -> list[str]:+ return [attributes.get("href", "") for attributes in self.elements("a")]diff --git a/autogpt_platform/backend/backend/notifications/email.py b/autogpt_platform/backend/backend/notifications/email.pyindex ecf0637e74..b85379db12 100644--- a/autogpt_platform/backend/backend/notifications/email.py+++ b/autogpt_platform/backend/backend/notifications/email.py@@ -3,8 +3,8 @@Everything goes out on a transactional stream, separate from marketing mail(which the platform does not send at all — the onboarding tour and the monthlychangelog are MailerLite's). Every message carries a plain-text MIME part built-from the same data model, and one-click List-Unsubscribe headers on every-family except Ops, which is internal mail and deliberately not opt-in.+from the same data model. Product notifications carry one-click+List-Unsubscribe headers; billing, auth and internal Ops mail do not."""import asyncio@@ -60,11 +60,12 @@ class EmailSender:data: BaseNotificationData,unsubscribe_link: str,volume_links: dict[str, str] | None = None,+ first_name: str | None = None,) -> None:"""Render and send one notification. Raises on delivery failure so thequeue consumer's retry-with-backoff can recover."""urls = build_urls(unsubscribe_link, volume_links)- email = render(notification_type, data, user_email, urls)+ email = render(notification_type, data, user_email, urls, first_name=first_name)await self._deliver(notification_type, user_email, email, urls)async def _deliver(@@ -82,16 +83,20 @@ class EmailSender:if supports_list_unsubscribe(notification_type)else None)+ stream = get_delivery_stream(notification_type)await self._send(user_email=user_email,- sender=_sender_for(get_delivery_stream(notification_type)),+ sender=_sender_for(stream),+ reply_to=_reply_to_for(stream),subject=email.subject,html_body=email.html,text_body=email.text,headers=headers,)- def send_email_or_raise(self, user_email: str, subject: str, body: str) -> None:+ def send_email_or_raise(+ self, user_email: str, subject: str, body: str, text_body: str | None = None+ ) -> None:"""Send a one-off transactional email (e.g. Better Auth password-resetand verification links) with no notification templating or preferencegating. Raises if the Postmark client is not configured so callers can@@ -103,6 +108,7 @@ class EmailSender:To=user_email,Subject=subject,HtmlBody=body,+ TextBody=text_body,MessageStream=settings.config.postmark_transactional_stream,)@@ -114,6 +120,7 @@ class EmailSender:html_body: str,text_body: str,headers: dict[str, str] | None,+ reply_to: str | None = None,) -> None:if not self.postmark:logger.warning("Email tried to send without Postmark configured")@@ -124,6 +131,7 @@ class EmailSender:await asyncio.to_thread(self.postmark.emails.send,From=sender,+ ReplyTo=reply_to,To=user_email,Subject=subject,HtmlBody=html_body,@@ -139,3 +147,11 @@ def _sender_for(stream: DeliveryStream) -> str:DeliveryStream.PRODUCT: settings.config.product_sender_email,DeliveryStream.OPS: settings.config.ops_sender_email,}[stream]+++def _reply_to_for(stream: DeliveryStream) -> str | None:+ return {+ DeliveryStream.BILLING: settings.config.billing_reply_to_email,+ DeliveryStream.PRODUCT: settings.config.product_reply_to_email,+ DeliveryStream.OPS: None,+ }[stream]diff --git a/autogpt_platform/backend/backend/notifications/email_test.py b/autogpt_platform/backend/backend/notifications/email_test.pynew file mode 100644index 0000000000..57d1eb54ff--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/email_test.py@@ -0,0 +1,113 @@+"""The Postmark envelope preserves sender, stream and unsubscribe semantics."""++from unittest.mock import MagicMock++import pytest+from prisma.enums import NotificationType++from backend.notifications import email as delivery+from backend.notifications.renderer import RenderedEmail, build_urls+++ "notification_type,sender_key,reply_to_key",+ [+ (+ NotificationType.PAYMENT_FAILED,+ "billing_sender_email",+ "billing_reply_to_email",+ ),+ (NotificationType.ALERT, "product_sender_email", "product_reply_to_email"),+ (NotificationType.BRIEFING, "product_sender_email", "product_reply_to_email"),+ (NotificationType.VERDICT, "product_sender_email", "product_reply_to_email"),+ ],+)+async def test_reply_to_preserves_configured_sender_and_stream(+ monkeypatch, notification_type, sender_key, reply_to_key+):+ monkeypatch.setattr(+ delivery.settings.config, sender_key, "AutoGPT <[email protected]>"+ )+ monkeypatch.setattr(delivery.settings.config, reply_to_key, "[email protected]")+ monkeypatch.setattr(+ delivery.settings.config, "postmark_transactional_stream", "service"+ )+ sender = delivery.EmailSender.__new__(delivery.EmailSender)+ sender.postmark = MagicMock()+ urls = build_urls("https://example.org/unsubscribe?token=abc")+ message = RenderedEmail(+ subject="Account update", preheader="News", html="<p>News</p>", text="News"+ )++ await sender._deliver(notification_type, "[email protected]", message, urls)++ envelope = sender.postmark.emails.send.call_args.kwargs+ assert envelope["From"] == "AutoGPT <[email protected]>"+ assert envelope["ReplyTo"] == "[email protected]"+ assert envelope["MessageStream"] == "service"+ assert envelope["HtmlBody"] == message.html+ assert envelope["TextBody"] == message.text+ if notification_type == NotificationType.PAYMENT_FAILED:+ assert not envelope["Headers"]+ else:+ assert envelope["Headers"] == {+ "List-Unsubscribe": f"<{urls.unsubscribe}>",+ "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",+ }+++def test_auth_delivery_includes_text_without_unsubscribe(monkeypatch):+ sender = delivery.EmailSender.__new__(delivery.EmailSender)+ sender.postmark = MagicMock()+ monkeypatch.setattr(+ delivery.settings.config, "postmark_sender_email", "AutoGPT <[email protected]>"+ )+ monkeypatch.setattr(+ delivery.settings.config, "postmark_transactional_stream", "service"+ )++ sender.send_email_or_raise(+ "[email protected]",+ "Verify email",+ "<p>Verify</p>",+ "Verify: https://example.org/verify?token=abc",+ )++ envelope = sender.postmark.emails.send.call_args.kwargs+ assert envelope["From"] == "AutoGPT <[email protected]>"+ assert envelope["MessageStream"] == "service"+ assert envelope["TextBody"] == "Verify: https://example.org/verify?token=abc"+ assert not envelope.get("Headers")+ assert not envelope.get("ReplyTo")+++async def test_ops_keeps_its_sender_without_reply_to_or_unsubscribe(monkeypatch):+ sender = delivery.EmailSender.__new__(delivery.EmailSender)+ sender.postmark = MagicMock()+ monkeypatch.setattr(+ delivery.settings.config, "ops_sender_email", "Ops <[email protected]>"+ )++ await sender._deliver(+ NotificationType.OPS,+ "[email protected]",+ RenderedEmail(+ subject="Refund", preheader="Refund", html="<p>Refund</p>", text="Refund"+ ),+ build_urls("https://example.org/unsubscribe"),+ )++ envelope = sender.postmark.emails.send.call_args.kwargs+ assert envelope["From"] == "Ops <[email protected]>"+ assert not envelope.get("ReplyTo")+ assert not envelope.get("Headers")+++def test_auth_delivery_reports_missing_configuration():+ sender = delivery.EmailSender.__new__(delivery.EmailSender)+ sender.postmark = None++ with pytest.raises(RuntimeError, match="Postmark is not configured"):+ sender.send_email_or_raise("[email protected]", "Verify email", "<p>Verify</p>")diff --git a/autogpt_platform/backend/backend/notifications/lifecycle.py b/autogpt_platform/backend/backend/notifications/lifecycle.pyindex af67486cb8..9faa63807f 100644--- a/autogpt_platform/backend/backend/notifications/lifecycle.py+++ b/autogpt_platform/backend/backend/notifications/lifecycle.py@@ -41,6 +41,7 @@ from backend.notifications.queue import queue_audience_change, queue_notificatiofrom backend.notifications.subscriber_fields import audience_eventfrom backend.notifications.trial import notify_trial, on_trial_subscription_updatedfrom backend.util.clients import get_database_manager_async_client+from backend.util.feature_flag import Flag, is_feature_enabledfrom backend.util.logging import TruncatedLoggerfrom backend.util.product_analytics import track_subscription_endedfrom backend.util.settings import Settings@@ -125,6 +126,11 @@ async def on_checkout_completed(session: dict, subscription: dict) -> None:returnplan = await plan_from_subscription(subscription)+ experts_enabled = False+ try:+ experts_enabled = await is_feature_enabled(Flag.HIRE_EXPERTS, user.id)+ except Exception:+ logger.warning("Could not check Expert access; using the workflow welcome")try:await _publish(NotificationEventModel[SubscriptionWelcomeData](@@ -134,6 +140,7 @@ async def on_checkout_completed(session: dict, subscription: dict) -> None:user_name=_greeting_name(user),plan=plan,renews_label=format_date(subscription.get("current_period_end")),+ experts_enabled=experts_enabled,),))diff --git a/autogpt_platform/backend/backend/notifications/lifecycle_plan.py b/autogpt_platform/backend/backend/notifications/lifecycle_plan.pyindex 9393987c96..182550ef39 100644--- a/autogpt_platform/backend/backend/notifications/lifecycle_plan.py+++ b/autogpt_platform/backend/backend/notifications/lifecycle_plan.py@@ -48,7 +48,7 @@ async def plan_from_subscription(subscription: dict) -> SubscriptionPlan:name=name,cycle=cycle,cycle_noun="month" if cycle == "monthly" else "year",- label=f"{name} — {cycle}",+ label=f"{name} · {cycle}",price_display=f"{format_amount(price.get('unit_amount'), price.get('currency', 'usd'))} / {'month' if cycle == 'monthly' else 'year'}",)@@ -63,7 +63,7 @@ async def plan_from_invoice(invoice: dict) -> SubscriptionPlan:name=name,cycle=cycle,cycle_noun="month" if cycle == "monthly" else "year",- label=f"{name} — {cycle}",+ label=f"{name} · {cycle}",price_display=f"{format_amount(price.get('unit_amount'), price.get('currency', 'usd'))} / {'month' if cycle == 'monthly' else 'year'}",)@@ -95,7 +95,7 @@ def format_amount(minor_units: int | None, currency: str) -> str:"""Stripe amounts are in the currency's minor unit, except where theyaren't."""if minor_units is None:- return "—"+ return "Not available"symbol = {"usd": "$", "eur": "€", "gbp": "£"}.get(currency.lower(), "")if currency.lower() in _ZERO_DECIMAL_CURRENCIES:return f"{symbol}{minor_units:,}"@@ -105,7 +105,7 @@ def format_amount(minor_units: int | None, currency: str) -> str:def format_date(timestamp: int | None) -> str:"""The one fact these emails exist to state, so it is never relative."""if not timestamp:- return "—"+ return "Not available"moment = datetime.fromtimestamp(timestamp, tz=timezone.utc)return f"{moment.day} {moment.strftime('%b %Y')}"diff --git a/autogpt_platform/backend/backend/notifications/lifecycle_test.py b/autogpt_platform/backend/backend/notifications/lifecycle_test.pyindex 2ca03952a6..3b81448e3e 100644--- a/autogpt_platform/backend/backend/notifications/lifecycle_test.py+++ b/autogpt_platform/backend/backend/notifications/lifecycle_test.py@@ -120,6 +120,10 @@ def _context(user, claim=True, audience_ok=True):AsyncMock(return_value=("PRO", "monthly")),),patch("backend.notifications.lifecycle.track_subscription_ended"),+ patch(+ "backend.notifications.lifecycle.is_feature_enabled",+ AsyncMock(return_value=False),+ ),]@@ -650,3 +654,41 @@ async def test_an_ended_subscription_sets_stripes_end_date_on_the_churn(fields_oSubscriberField.STATUS: SubscriptionStatus.SUBSCRIPTION_ENDED.value,SubscriberField.SUBSCRIPTION_ENDED: _day(1789200000),}+++ "enabled,error",+ [+ (False, None),+ (True, None),+ (False, RuntimeError("Flag lookup failed for [email protected]")),+ ],+)+async def test_welcome_matches_the_recipients_expert_access(enabled, error, caplog):+ patches = _context(_User())+ patches.append(+ patch.object(lifecycle, "_claim_welcome", AsyncMock(return_value=True))+ )+ for item in patches:+ item.start()+ try:+ with patch.object(+ lifecycle,+ "is_feature_enabled",+ AsyncMock(return_value=enabled, side_effect=error),+ ) as flag, patch.object(lifecycle, "_release_welcome", AsyncMock()) as released:+ await lifecycle.on_checkout_completed(+ {"customer": CUSTOMER}, _subscription()+ )+ event = lifecycle.queue_notification_async.call_args.args[0]+ assert event.data.experts_enabled is enabled+ flag.assert_awaited_once_with(lifecycle.Flag.HIRE_EXPERTS, "user-1")+ released.assert_not_awaited()+ lifecycle.queue_audience_change.assert_awaited_once()+ if error:+ assert "Could not check Expert access" in caplog.text+ assert "[email protected]" not in caplog.text+ assert "user-1" not in caplog.text+ finally:+ for item in reversed(patches):+ item.stop()diff --git a/autogpt_platform/backend/backend/notifications/notifications.py b/autogpt_platform/backend/backend/notifications/notifications.pyindex b6467151b5..042bff0f0c 100644--- a/autogpt_platform/backend/backend/notifications/notifications.py+++ b/autogpt_platform/backend/backend/notifications/notifications.py@@ -47,6 +47,7 @@ from backend.notifications.queue import (create_notification_config,queue_notification_async,)+from backend.notifications.recipient import greeting_namefrom backend.notifications.trial import trial_notice_dispositionfrom backend.util.clients import get_database_manager_async_clientfrom backend.util.logging import TruncatedLogger@@ -258,12 +259,14 @@ class NotificationManager(AppService):logger.warning(f"Failed to send Discord system alert: {e}")@expose- async def send_email_or_raise(self, to: str, subject: str, body: str):+ async def send_email_or_raise(+ self, to: str, subject: str, body: str, text_body: str | None = None+ ):"""One-off transactional email (e.g. Better Auth password-reset linksforwarded by the REST API). Deliberately not wrapped in try/except: adelivery failure must reach the RPC caller."""await asyncio.to_thread(- self.email_sender.send_email_or_raise, to, subject, body+ self.email_sender.send_email_or_raise, to, subject, body, text_body)# ── consumers ───────────────────────────────────────────────────────@@ -330,6 +333,11 @@ class NotificationManager(AppService):await self.email_sender.send_notification(notification_type=event.type,user_email=preference.email,+ first_name=(+ await greeting_name(event.user_id)+ if event.type not in SERVICE_MESSAGES+ else None+ ),data=event.data,unsubscribe_link=generate_unsubscribe_link(event.user_id),volume_links={diff --git a/autogpt_platform/backend/backend/notifications/recipient.py b/autogpt_platform/backend/backend/notifications/recipient.pynew file mode 100644index 0000000000..720a50c09e--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/recipient.py@@ -0,0 +1,25 @@+"""Best-effort personalization must never delay an account notification."""++import asyncio+import logging++from backend.util.clients import get_database_manager_async_client++logger = logging.getLogger(__name__)+++async def greeting_name(user_id: str) -> str:+ try:+ user = await asyncio.wait_for(+ get_database_manager_async_client(should_retry=False).get_user_by_id(+ user_id+ ),+ timeout=2,+ )+ except Exception:+ logger.debug(+ "Recipient name unavailable; using a neutral greeting", exc_info=True+ )+ return "there"+ names = (user.name or "").split() if user else []+ return names[0] if names else "there"diff --git a/autogpt_platform/backend/backend/notifications/recipient_test.py b/autogpt_platform/backend/backend/notifications/recipient_test.pynew file mode 100644index 0000000000..019158a520--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/recipient_test.py@@ -0,0 +1,30 @@+from types import SimpleNamespace+from unittest.mock import AsyncMock++import pytest++from backend.notifications import recipient+++ "name,expected", [("Sam Carter", "Sam"), ("", "there"), (None, "there")]+)+async def test_greeting_uses_only_the_first_name(monkeypatch, name, expected):+ client = SimpleNamespace(+ get_user_by_id=AsyncMock(return_value=SimpleNamespace(name=name))+ )+ monkeypatch.setattr(+ recipient, "get_database_manager_async_client", lambda **kw: client+ )+ assert await recipient.greeting_name("user-1") == expected+ client.get_user_by_id.assert_awaited_once_with("user-1")+++async def test_missing_name_does_not_block_delivery(monkeypatch):+ client = SimpleNamespace(get_user_by_id=AsyncMock(side_effect=TimeoutError))+ monkeypatch.setattr(+ recipient, "get_database_manager_async_client", lambda **kw: client+ )+ assert await recipient.greeting_name("user-1") == "there"diff --git a/autogpt_platform/backend/backend/notifications/renderer.py b/autogpt_platform/backend/backend/notifications/renderer.pyindex 8f8c54788e..0e1b39feee 100644--- a/autogpt_platform/backend/backend/notifications/renderer.py+++ b/autogpt_platform/backend/backend/notifications/renderer.py@@ -13,7 +13,7 @@ The subject template renders first and produces two lines (subject, thenpreheader); both are then passed into the body template."""-import pathlib+from urllib.parse import urlsplitfrom jinja2 import Environment, FileSystemLoaderfrom prisma.enums import NotificationType@@ -24,30 +24,19 @@ from backend.data.notifications import (get_lifecycle_kind,get_template_family,)+from backend.notifications.template_env import TEMPLATE_DIR, create_body_environmentfrom backend.util.settings import Settingssettings = Settings()-TEMPLATE_DIR = pathlib.Path(__file__).parent / "templates"-# Autoescape is the defence for user-supplied values, so it is not optional.-_html_env = Environment(- loader=FileSystemLoader(TEMPLATE_DIR),- autoescape=True,- trim_blocks=True,- lstrip_blocks=True,-)+_html_env = create_body_environment(autoescape=True)# NB: no trim_blocks here — the subject template's line break between subject# and preheader must survive block tags at end-of-line._subject_env = Environment(loader=FileSystemLoader(TEMPLATE_DIR), autoescape=False)# The plain-text part is built from the same context, so a text-only client# gets the same facts rather than a tag-stripped approximation of the HTML.-_text_env = Environment(- loader=FileSystemLoader(TEMPLATE_DIR),- autoescape=False,- trim_blocks=True,- lstrip_blocks=True,-)+_text_env = create_body_environment(autoescape=False)class RenderedEmail(BaseModel):@@ -103,10 +92,12 @@ def render(data: BaseNotificationData,user_email: str,urls: EmailUrls,+ first_name: str | None = None,) -> RenderedEmail:"""Render one notification into subject, preheader, HTML and plain text."""family = get_template_family(notification_type)context = _build_context(notification_type, data, user_email, urls)+ context["first_name"] = first_name or "there"subject, preheader = _render_subject(family, context)html = _html_env.get_template(f"{family}.html.j2").render(@@ -139,11 +130,19 @@ def _build_context(# undefined, not on None. Only the top level, so `totals.usd_estimate`# survives for its `is not none` test.context = {k: v for k, v in data.model_dump().items() if v is not None}- context["user_email"] = user_email+ context.setdefault("user_email", user_email)context["urls"] = urls.model_dump()# Hero art is hosted, not inline: Outlook does not render inline SVG, and# Gmail does not display data-URI images.context["assets"] = settings.config.email_asset_base_url.rstrip("/")+ asset_url = urlsplit(context["assets"])+ context["otto_asset_url"] = (+ f"{asset_url.scheme}://{asset_url.netloc}"+ "/autogpt-characters/v1.1/otto/neutral/256.png"+ )+ if "plan" in context:+ plan = context["plan"]+ plan["label"] = f"{plan['name']} · {plan['cycle']}"if kind := get_lifecycle_kind(notification_type):context["kind"] = kindreturn contextdiff --git a/autogpt_platform/backend/backend/notifications/renderer_test.py b/autogpt_platform/backend/backend/notifications/renderer_test.pyindex 1f576fd0fc..c5521b9456 100644--- a/autogpt_platform/backend/backend/notifications/renderer_test.py+++ b/autogpt_platform/backend/backend/notifications/renderer_test.py@@ -50,7 +50,7 @@ PLAN = SubscriptionPlan(name="Pro",cycle="monthly",cycle_noun="month",- label="Pro — monthly",+ label="Pro · monthly",price_display="$50.00 / month",)@@ -303,3 +303,80 @@ def test_onboarding_template_names_otto_and_links_to_chat(part, cta):assert "AutoPilot" not in htmlassert cta in htmlassert 'href="https://p.example/copilot"' in html++[email protected]("enabled", [False, True])+def test_welcome_uses_an_available_marketplace_action(enabled):+ data = WELCOME.model_copy(update={"experts_enabled": enabled})+ email = render(NotificationType.SUBSCRIPTION_WELCOME, data, "[email protected]", URLS)+ expected = "Hire your first Expert" if enabled else "Install your first workflow"+ assert expected in email.html+ assert expected in email.text+ assert "Pro · monthly" in email.html+ marketplace_label = "Browse Experts" if enabled else "Browse workflows"+ opposite_label = "Browse workflows" if enabled else "Browse Experts"+ for part in (email.html, email.text):+ assert marketplace_label in part+ assert opposite_label not in part+ if not enabled:+ assert "Hire your first Expert" not in email.html+++ "cycle, cycle_noun, price_display",+ [("monthly", "month", "$50.00 / month"), ("yearly", "year", "$480.00 / year")],+)+def test_welcome_displays_the_plan_billing_cycle(cycle, cycle_noun, price_display):+ plan = PLAN.model_copy(+ update={+ "cycle": cycle,+ "cycle_noun": cycle_noun,+ "label": f"Pro · {cycle}",+ "price_display": price_display,+ }+ )+ data = WELCOME.model_copy(update={"plan": plan})+ email = render(NotificationType.SUBSCRIPTION_WELCOME, data, "[email protected]", URLS)++ for part in (email.html, email.text):+ assert f"Pro · {cycle}" in part+ assert price_display in part+ other_cycle = "monthly" if cycle == "yearly" else "yearly"+ assert other_cycle not in part.lower()+++def test_legacy_queued_plan_label_is_normalized_without_mutating_the_payload():+ legacy_plan = PLAN.model_copy(update={"label": "Pro — monthly"})+ data = WELCOME.model_copy(update={"plan": legacy_plan})+ email = render(NotificationType.SUBSCRIPTION_WELCOME, data, "[email protected]", URLS)++ for part in (email.html, email.text):+ assert "Pro · monthly" in part+ assert "Pro — monthly" not in part+ assert data.plan.label == "Pro — monthly"+++def test_otto_uses_the_configured_image_host(monkeypatch):+ from backend.notifications import renderer++ monkeypatch.setattr(+ renderer.settings.config,+ "email_asset_base_url",+ "https://assets.example/email/",+ )+ email = render(+ NotificationType.SUBSCRIPTION_WELCOME, WELCOME, "[email protected]", URLS+ )+ assert 'src="https://assets.example/email/logo-light.png"' in email.html+ assert (+ 'src="https://assets.example/autogpt-characters/v1.1/otto/neutral/256.png"'+ in email.html+ )+++def test_product_greeting_is_personalized_and_escaped():+ email = render(+ NotificationType.ALERT, ALERT, "[email protected]", URLS, first_name="<Sam>"+ )+ assert "Hi <Sam>" in email.html+ assert "Hi <Sam>" in email.textdiff --git a/autogpt_platform/backend/backend/notifications/review_alerts.py b/autogpt_platform/backend/backend/notifications/review_alerts.pyindex c3f2829025..42325aecd0 100644--- a/autogpt_platform/backend/backend/notifications/review_alerts.py+++ b/autogpt_platform/backend/backend/notifications/review_alerts.py@@ -52,8 +52,10 @@ async def sync_awaiting_review(cause_key = f"awaiting_review:{graph_id}"else:return+ where["userId"] = user_id+ where["status"] = ReviewStatus.WAITINGwaiting = await PendingHumanReview.prisma().find_many(- where={**where, "userId": user_id, "status": ReviewStatus.WAITING},+ where=where,order={"createdAt": "asc"},)if not waiting:@@ -73,7 +75,7 @@ async def sync_awaiting_review(cta_path=cta_path,agent=agent,count=len(waiting),- since_label=f"{oldest.day} {oldest.strftime('%b')}, {oldest.strftime('%H:%M')}",+ since_label=f"{oldest.day} {oldest.strftime('%b %Y')}, {oldest.strftime('%H:%M')} UTC",)await alerts_db.raise_alert_condition(user_id=user_id,diff --git a/autogpt_platform/backend/backend/notifications/template_env.py b/autogpt_platform/backend/backend/notifications/template_env.pynew file mode 100644index 0000000000..3ffc05b24a--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/template_env.py@@ -0,0 +1,16 @@+"""Shared Jinja configuration for HTML and plain-text email bodies."""++from pathlib import Path++from jinja2 import Environment, FileSystemLoader++TEMPLATE_DIR = Path(__file__).parent / "templates"+++def create_body_environment(*, autoescape: bool) -> Environment:+ return Environment(+ loader=FileSystemLoader(TEMPLATE_DIR),+ autoescape=autoescape,+ trim_blocks=True,+ lstrip_blocks=True,+ )diff --git a/autogpt_platform/backend/backend/notifications/templates/_email_ui.j2 b/autogpt_platform/backend/backend/notifications/templates/_email_ui.j2new file mode 100644index 0000000000..e3c2bd9e3d--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/templates/_email_ui.j2@@ -0,0 +1,391 @@+{# ============================================================+ _email_ui.j2: AutoGPT email design system, Edition 1 (2 Oct 2026)+ One component kit for every Postmark family (billing, product,+ ops, auth), with shared layout, typography, actions, cards,+ character assets, and stream-specific footers.+ Tokens (source in the design system page):+ paper #ECEAF6 · sheet #FFFFFF · panel #F5F3FC · hairline #E7E4F4+ ink #171925 · body #2D2A3E · muted #575072+ purple #6144DF (one action color) · purple deep #4D36AD (fine-print links)+ green #1C7A52 · amber #E8940A / #FFF6E8 / #F2DCB0 / #B45309 / #8A5800+ Otto band #FDFCF8 (sampled from the v1.1 master's background)+ Pass `assets` (email_asset_base_url) in the render context.+ Import **with context**.+ ============================================================ #}++{%- set FONT = "Geist, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" -%}+{%- set MONO = "'Geist Mono', ui-monospace, Menlo, Consolas, monospace" -%}+{%- set OTTO = otto_asset_url | default("https://platform.agpt.co/autogpt-characters/v1.1/otto/neutral/256.png", true) -%}++{%- macro head_block(title_text) -%}+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<meta name="color-scheme" content="light">+<meta name="supported-color-schemes" content="light">+<title>{{ title_text }}</title>+<style>+ @import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');+ html, body { margin:0 !important; padding:0 !important; width:100% !important; }+ table { border-collapse:collapse; }+ a { text-decoration:none; }+ @media only screen and (max-width: 600px) {+ .sheet { width:100% !important; }+ .gutter { padding-left:22px !important; padding-right:22px !important; }+ .headline { font-size:23px !important; line-height:31px !important; }+ .sum { font-size:10px !important; letter-spacing:0 !important; }+ .mobile-hide { display:none !important; }+ .kvl { display:block !important; width:100% !important; padding:10px 0 2px !important; border-top:1px solid #E7E4F4 !important; }+ .kvv { display:block !important; width:100% !important; text-align:left !important; padding:0 0 10px !important; border-top:0 !important; font-size:12px !important; }+ .kvfirst { border-top:0 !important; padding-top:0 !important; }+ }+</style>+{%- endmacro -%}++{# Body tag with the system font stack and paper background applied. #}+{%- macro body_open() -%}+<body style="margin:0; padding:0; background-color:#ECEAF6; -webkit-text-size-adjust:100%; font-family:{{ FONT }};">+{%- endmacro -%}++{%- macro preheader(text) -%}+<div style="display:none; font-size:1px; color:#ECEAF6; line-height:1px; max-height:0; overflow:hidden;">+ {{ text }} ‌ ‌ ‌ ‌ ‌+</div>+{%- endmacro -%}++{%- macro page_open() -%}+<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#ECEAF6">+<tr><td align="center" style="padding:32px 12px 44px;">+ <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" bgcolor="#ECEAF6" class="sheet" style="width:560px; max-width:560px;">+{%- endmacro -%}++{%- macro page_close() -%}+ </table>+{%- endmacro -%}++{# Masthead: ink band, the wordmark with the octopus eyes, 100x45. #}+{%- macro masthead() -%}+ <tr><td bgcolor="#171925" align="center" style="border-radius:16px 16px 0 0; padding:10px 0 8px; line-height:0;">+ <a href="https://agpt.co" style="display:inline-block;"><img src="{{ assets | default('https://platform.agpt.co/email', true) }}/logo-light.png" width="100" height="45" alt="AutoGPT" style="display:block; border:0;"></a>+ </td></tr>+{%- endmacro -%}+{# Header uses the shared masthead. #}+{%- macro header() -%}{{ masthead() }}{%- endmacro -%}++{# The one character slot: the neutral Otto v1.1 master from the managed+ library, on its own sampled background. No per-state faces in email. #}+{%- macro hero_otto() -%}+ <tr><td bgcolor="#FDFCF8" align="center" style="padding:0; line-height:0; font-size:0;">+ <img src="{{ OTTO }}" width="160" height="160" alt="Otto, your personal Head of AI"+ style="display:block; width:160px; max-width:100%; height:auto; border:0; outline:none; text-decoration:none;">+ </td></tr>+{%- endmacro -%}+{# Every hero variant renders the same neutral Otto, regardless of its arguments. #}+{%- macro hero(state) -%}{{ hero_otto() }}{%- endmacro -%}+{%- macro hero_img(name, bgc, alt) -%}{{ hero_otto() }}{%- endmacro -%}+{%- macro hero_briefing(state) -%}{{ hero_otto() }}{%- endmacro -%}+{%- macro hero_verdict(state) -%}{{ hero_otto() }}{%- endmacro -%}+{%- macro hero_alert() -%}{{ hero_otto() }}{%- endmacro -%}++{# White sheet below the masthead/hero. Close with sheet_close(). #}+{%- macro sheet_open() -%}+ <tr><td bgcolor="#FFFFFF" style="border-radius:0 0 16px 16px;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF" style="border-collapse:separate; border-spacing:0; border-radius:0 0 16px 16px;">+{%- endmacro -%}+{%- macro sheet_close() -%}+ </table>+ </td></tr>+{%- endmacro -%}++{%- macro strip_amber(text) -%}+ <tr><td bgcolor="#FFF6E8" class="gutter" style="padding:12px 48px; border-bottom:1px solid #F2DCB0;">+ <div style="font-size:12px; font-weight:700; letter-spacing:2px; color:#B45309;">▲ {{ text }}</div>+ </td></tr>+{%- endmacro -%}++{# tone: neutral | confirmed | needs_you | brand. `color` overrides the tone. #}+{%- macro eyebrow(color=none, top=26, tone='neutral') -%}+{%- set c = color if color else {'neutral': '#575072', 'confirmed': '#1C7A52', 'needs_you': '#B45309', 'brand': '#6144DF'}[tone] -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <div style="font-size:12px; font-weight:700; letter-spacing:2px; color:{{ c }};">{{ caller() }}</div>+ </td></tr>+{%- endmacro -%}++{%- macro section_label(text, color='#575072') -%}+ <div style="font-size:12px; font-weight:700; letter-spacing:2px; color:{{ color }};">{{ text }}</div>+{%- endmacro -%}++{%- macro headline(top=8) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <div class="headline" style="font-size:26px; line-height:34px; font-weight:700; letter-spacing:-0.3px; color:#171925; overflow-wrap:anywhere; word-break:break-word;">{{ caller() }}</div>+ </td></tr>+{%- endmacro -%}++{%- macro para(top=16, color='#2D2A3E', size=15, lh=24) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <div style="font-size:{{ size }}px; line-height:{{ lh }}px; color:{{ color }};">{{ caller() }}</div>+ </td></tr>+{%- endmacro -%}++{# Single key/value row (ops/alert facts). Wrap rows in your own table. #}+{%- macro kv(label, value, mono=true, first=false) -%}+ <tr>+ <td width="150" valign="top" class="kvl{{ ' kvfirst' if first }}" style="padding:{{ '0' if first else '9px' }} 12px 9px 0; font-size:13px; color:#575072; border-top:{{ '0' if first else '1px solid #E7E4F4' }};">{{ label }}</td>+ <td valign="top" align="right" class="kvv" style="padding:{{ '0' if first else '9px' }} 0 9px; {% if mono %}font-family:{{ MONO }}; font-size:13px;{% else %}font-size:14px;{% endif %} color:#171925; border-top:{{ '0' if first else '1px solid #E7E4F4' }}; overflow-wrap:anywhere;">{{ value }}</td>+ </tr>+{%- endmacro -%}++{# rows: list of (label, value, mono) #}+{%- macro kvpanel(rows, top=18) -%}+{%- set background = '#F5F3FC' -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F3FC" style="border-radius:10px;">+ <tr><td style="padding:14px 18px;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ {%- for label, value, mono in rows %}+ {{ kv(label, value, mono=mono, first=loop.first) }}+ {%- endfor %}+ </table>+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{# tone: 'amber' | 'neutral'. Content comes from `body` or a call block. #}+{%- macro note_card(label, body=none, tone='neutral', top=20) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ '#FFF6E8' if tone == 'amber' else '#F5F3FC' }}" style="border-collapse:separate; border-spacing:0; border:1px solid {{ '#F2DCB0' if tone == 'amber' else '#E7E4F4' }}; border-left:4px solid {{ '#E8940A' if tone == 'amber' else '#6144DF' }}; border-radius:10px;">+ <tr><td style="padding:16px 18px;">+ <div style="font-size:11px; font-weight:700; letter-spacing:2px; color:{{ '#8A5800' if tone == 'amber' else '#575072' }}; padding-bottom:7px;">{{ label | upper }}</div>+ <div style="font-size:15px; line-height:24px; color:#2D2A3E; overflow-wrap:anywhere;">{% if body is not none %}{{ body }}{% else %}{{ caller() }}{% endif %}</div>+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{%- macro trunc(s, n=40) -%}+{%- if s | length <= n -%}{{ s }}+{%- else -%}+{%- set cut = s[:n-1] -%}+{%- set sp = cut.rfind(' ') -%}+{%- set base = cut[:sp] if sp > ((n * 6) // 10) else cut -%}+{%- set base = base | trim(' (&–—-·:,;') -%}+{%- if base.count('(') > base.count(')') -%}+{%- set base = base[:base.rfind('(')] | trim(' (&–—-·:,;') -%}+{%- endif -%}+{%- if base.count('“') > base.count('”') -%}+{%- set base = base[:base.rfind('“')] | trim(' (&“"–—-·:,;') -%}+{%- endif -%}+{{- base ~ '…' -}}+{%- endif -%}+{%- endmacro -%}++{%- macro btn(label, url) -%}+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">+ <tr><td bgcolor="#6144DF" style="border-radius:8px;">+ <a href="{{ url }}" style="display:inline-block; padding:13px 28px; font-size:15px; line-height:20px; font-weight:600; color:#ffffff; font-family:{{ FONT }};">{{ label }}</a>+ </td></tr>+ </table>+{%- endmacro -%}++{%- macro btn_small(label, url) -%}+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFF6E8"><tr><td bgcolor="#6144DF" style="border-radius:6px;">+ <a href="{{ url }}" style="display:inline-block; padding:8px 14px; font-size:13px; line-height:18px; font-weight:600; color:#ffffff; font-family:{{ FONT }};">{{ label }}</a>+ </td></tr></table>+{%- endmacro -%}++{%- macro cta(label, url, micro=none, top=24) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ {{ btn(label, url) }}+ {%- if micro %}+ <div style="padding-top:10px; font-size:12px; line-height:18px; color:#575072;">{{ micro }}</div>+ {%- endif %}+ </td></tr>+{%- endmacro -%}++{# item: object with title, body, cta_label, cta_url, optional tag. Emits the+ card without a wrapping row. Primary cards use a button; others use a text link. #}+{%- macro attention_card(item, primary=true) -%}+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFF6E8" style="border-collapse:separate; border-spacing:0; border:1px solid #F2DCB0; border-left:4px solid {{ '#E8940A' if primary else '#F0CF9A' }}; border-radius:10px;">+ <tr><td style="padding:16px 18px;">+ <div style="font-size:15px; font-weight:700; color:#171925;">+ <span style="color:#B45309;">▲</span> {{ trunc(item.title, 52) }}{% if item.tag %} <span style="font-size:11px; font-weight:700; letter-spacing:1px; color:#B45309; white-space:nowrap;">{{ item.tag|upper }}</span>{% endif %}+ </div>+ {% if item.body %}<div style="padding-top:5px; font-size:14px; line-height:21px; color:#2D2A3E;">{{ item.body }}</div>{% endif %}+ <div style="padding-top:11px;">{% if primary %}{{ btn_small(item.cta_label, item.cta_url) }}{% else %}<a href="{{ item.cta_url }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">{{ item.cta_label }}</a>{% endif %}</div>+ </td></tr>+ </table>+{%- endmacro -%}++{# items: list of (strong, text, link_label, url) #}+{%- macro also_panel(label, items, top=28) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F3FC" style="border-radius:10px;">+ <tr><td style="padding:15px 18px;">+ <div style="font-size:11px; font-weight:700; letter-spacing:2px; color:#575072; padding-bottom:5px;">{{ label | upper }}</div>+ {%- for strong, text, link_label, url in items %}+ <div style="font-size:14px; line-height:21px; color:#2D2A3E;{{ ' padding-top:8px;' if not loop.first }}">+ <strong style="color:#171925;">{{ strong }}</strong> {{ text }}+ <a href="{{ url }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">{{ link_label }}</a>+ </div>+ {%- endfor %}+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{# items: list of (lead, rest) #}+{%- macro steps(items, top=18) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ {%- for lead, rest in items %}+ <tr>+ <td width="26" valign="top" style="font-family:{{ MONO }}; font-size:13px; line-height:22px; font-weight:bold; color:#6144DF; padding-bottom:{{ '0' if loop.last else '12px' }};">{{ loop.index }}</td>+ <td valign="top" style="font-size:14px; line-height:22px; color:#2D2A3E; padding-bottom:{{ '0' if loop.last else '12px' }};"><strong style="color:#171925;">{{ lead }}</strong> {{ rest }}</td>+ </tr>+ {%- endfor %}+ </table>+ </td></tr>+{%- endmacro -%}++{# Single numbered step, rendered as a table. #}+{%- macro step(n, text) -%}+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ <tr>+ <td width="26" valign="top" style="font-family:{{ MONO }}; font-size:13px; line-height:22px; font-weight:bold; color:#6144DF;">{{ n }}</td>+ <td style="font-size:14px; line-height:22px; color:#2D2A3E;">{{ text }}</td>+ </tr>+ </table>+{%- endmacro -%}++{# items: list of (title, body), rendered without emoji. #}+{%- macro feature_cards(items, top=20) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ {%- for title, body in items %}+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F3FC" style="border-radius:10px;{{ ' margin-top:10px;' if not loop.first }}">+ <tr><td style="padding:13px 16px;">+ <div style="font-size:14px; font-weight:700; color:#171925;">{{ title }}</div>+ <div style="font-size:14px; line-height:21px; color:#2D2A3E; padding-top:3px;">{{ body }}</div>+ </td></tr>+ </table>+ {%- endfor %}+ </td></tr>+{%- endmacro -%}+{# items: list of (emoji, title, body). Only the title and body are rendered. #}+{%- macro emoji_cards(items, top=20) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ {%- for emoji, title, body in items %}+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F3FC" style="border-radius:10px;{{ ' margin-top:10px;' if not loop.first }}">+ <tr><td style="padding:13px 16px;">+ <div style="font-size:14px; font-weight:700; color:#171925;">{{ title }}</div>+ <div style="font-size:14px; line-height:21px; color:#2D2A3E; padding-top:3px;">{{ body }}</div>+ </td></tr>+ </table>+ {%- endfor %}+ </td></tr>+{%- endmacro -%}++{%- macro media_link(label, sub, url, top=20) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F3FC" style="border-radius:10px;">+ <tr><td style="padding:13px 16px;">+ <div style="font-size:14px; font-weight:700;"><a href="{{ url }}" style="color:#6144DF; text-decoration:underline;">▶ {{ label }}</a></div>+ <div style="font-size:13px; line-height:20px; color:#575072; padding-top:2px;">{{ sub }}</div>+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{%- macro signature(name, title, email=none, top=26) -%}+ <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">+ <div style="font-size:14px; font-weight:700; color:#171925;">{{ name }}</div>+ <div style="font-size:13px; line-height:20px; color:#575072;">{{ title }}</div>+ {%- if email %}+ <div style="font-size:13px; line-height:20px;"><a href="mailto:{{ email }}" style="color:#6144DF; text-decoration:underline;">{{ email }}</a></div>+ {%- endif %}+ </td></tr>+{%- endmacro -%}++{%- macro close_row(text, link_label, url) -%}+ <tr><td align="center" class="gutter" style="padding:22px 48px 24px;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ <tr><td height="1" bgcolor="#E7E4F4" style="font-size:0; line-height:0;"> </td></tr>+ <tr><td align="center" style="padding-top:12px; font-size:12px; line-height:19px; color:#575072;">+ {{ text }}<div style="padding-top:4px;"><a href="{{ url }}" style="color:#4D36AD; text-decoration:underline;">{{ link_label }}</a></div>+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{# Briefing only. links: dict daily|weekly|monthly|alerts|off -> signed url. #}+{%- macro volume_knob(links, current='weekly') -%}+ <tr><td align="center" class="gutter" style="padding:22px 48px 24px;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ <tr><td height="1" bgcolor="#E7E4F4" style="font-size:0; line-height:0;"> </td></tr>+ <tr><td align="center" style="padding-top:12px; font-size:12px; line-height:19px; color:#575072;">+ How often you get the Briefing:+ <div style="padding-top:4px;">+ {%- for key, lab in [('daily','Daily'),('weekly','Weekly'),('monthly','Monthly'),('alerts','Alerts only'),('off','Pause')] -%}+ {%- if not loop.first %} · {% endif -%}+ {%- if key == current -%}<strong style="color:#171925; font-weight:700;">{{ lab }}</strong>{%- else -%}<a href="{{ links.get(key) or (urls.settings ~ '?f=' ~ key) }}" style="color:#4D36AD; text-decoration:underline;">{{ lab }}</a>{%- endif -%}+ {%- endfor -%}+ </div>+ </td></tr>+ </table>+ </td></tr>+{%- endmacro -%}++{# Internal ops band: the amount is the hero. #}+{%- macro ops_band(eyebrow, amount_text, sub_text, status_label, status_bg) -%}+{%- set background = '#171925' -%}+ <tr><td bgcolor="#171925" class="gutter" style="padding:20px 48px 22px;">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}">+ <tr>+ <td valign="middle">+ <div style="font-size:11px; font-weight:700; letter-spacing:2px; color:#B3AFC9;">{{ eyebrow }}</div>+ <div style="padding-top:6px; font-family:{{ MONO }}; font-size:32px; font-weight:bold; color:#ffffff; letter-spacing:-0.5px;">{{ amount_text }}</div>+ <div style="padding-top:5px; font-size:13px; line-height:19px; color:#C9C5DD; overflow-wrap:anywhere;">{{ sub_text }}</div>+ <div style="padding-top:11px;">+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ background | default('#FFFFFF') }}"><tr>+ <td bgcolor="{{ status_bg }}" style="border-radius:4px; padding:5px 10px; font-family:{{ MONO }}; font-size:10px; font-weight:bold; letter-spacing:1.4px; color:#171925;">{{ status_label|upper }}</td>+ </tr></table>+ </div>+ </td>+ <td width="118" align="right" valign="middle" class="mobile-hide" style="line-height:0; font-size:0;">+ <img src="{{ OTTO }}" width="80" height="80" alt="Otto, your personal Head of AI" style="display:block; border:0; outline:none; text-decoration:none; border-radius:8px;">+ </td>+ </tr>+ </table>+ </td></tr>+{%- endmacro -%}++{# ---- Footers: one per stream. ------------------------------------------ #}+{%- macro _address() -%}+<a href="https://agpt.co" style="color:#4D36AD; text-decoration:underline;">AutoGPT</a>, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK+{%- endmacro -%}++{# Shared legal footer: registered address, a supplied link, and optional Discord. #}+{%- macro legal_footer(first_line, link_label, link_url, discord=false) -%}+ <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" bgcolor="#ECEAF6" class="sheet" style="width:560px; max-width:560px;">+ <tr><td align="center" style="padding:18px 24px 0; font-size:11px; line-height:18px; color:#575072;">+ {{ first_line }}<br>+ {{ _address() }} · + <a href="{{ link_url }}" style="color:#575072; text-decoration:underline;">{{ link_label }}</a>{% if discord %} · + <a href="{{ urls.discord | default('https://discord.gg/autogpt', true) }}" style="color:#575072; text-decoration:underline;">Discord</a>{% endif %}+ </td></tr>+ </table>+{%- endmacro -%}++{# Product (Briefing/Alert/Verdict): one-click unsubscribe link matching the+ List-Unsubscribe header. #}+{%- macro product_footer(first_line, unsubscribe_url, discord=true) -%}+{{ legal_footer(first_line, 'Unsubscribe', unsubscribe_url, discord=discord) }}+{%- endmacro -%}++{# Internal: no marketing chrome, no unsubscribe. #}+{%- macro internal_footer(line) -%}+ <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" bgcolor="#ECEAF6" class="sheet" style="width:560px; max-width:560px;">+ <tr><td align="center" style="padding:18px 24px 0; font-size:11px; line-height:18px; color:#575072;">+ {{ line }}<br>AutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK+ </td></tr>+ </table>+{%- endmacro -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/_lifecycle_ui.j2 b/autogpt_platform/backend/backend/notifications/templates/_lifecycle_ui.j2deleted file mode 100644index ca3143862d..0000000000--- a/autogpt_platform/backend/backend/notifications/templates/_lifecycle_ui.j2+++ /dev/null@@ -1,242 +0,0 @@-{# ============================================================- _lifecycle_ui.j2 — shared components for AutoGPT lifecycle- (billing & account) emails. Same design system as _ui.j2:- #eceaf6 paper, 560px sheet, #070629 masthead with the logo,- 560x184 hero art with bgcolor fallback, #5635b2 actions,- AA-corrected fine-print grays (#575072 / #575072) and- step numerals at #5635b2.- Pass `assets` in the render context as the base URL for- logo-light.png and the hero art. Import **with context**.- ============================================================ #}--{%- macro head_block(title_text) -%}-<meta charset="utf-8">-<meta name="viewport" content="width=device-width, initial-scale=1">-<meta name="color-scheme" content="light">-<title>{{ title_text }}</title>-<style>- @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');- html, body { margin:0 !important; padding:0 !important; width:100% !important; }- table { border-collapse:collapse; }- a { text-decoration:none; }- @media only screen and (max-width: 600px) {- .sheet { width:100% !important; }- .gutter { padding-left:22px !important; padding-right:22px !important; }- .headline { font-size:23px !important; line-height:31px !important; }- .mobile-hide { display:none !important; }- .kvl { display:block !important; width:100% !important; padding:10px 0 2px !important; border-top:1px solid #e7e4f4 !important; }- .kvv { display:block !important; width:100% !important; text-align:left !important; padding:0 0 10px !important; border-top:0 !important; font-size:11px !important; }- .kvfirst { border-top:0 !important; padding-top:0 !important; }- }-</style>-{%- endmacro -%}--{%- macro preheader(text) -%}-<div style="display:none; font-size:1px; color:#eceaf6; line-height:1px; max-height:0; overflow:hidden;">- {{ text }} ‌ ‌ ‌ ‌ ‌-</div>-{%- endmacro -%}--{%- macro page_open() -%}-<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#eceaf6">-<tr><td align="center" style="padding:32px 12px 44px;">- <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" class="sheet" style="width:560px; max-width:560px;">-{%- endmacro -%}--{%- macro page_close() -%}- </table>-{%- endmacro -%}--{%- macro masthead() -%}- <tr><td bgcolor="#070629" align="center" style="border-radius:16px 16px 0 0; padding:8px 0 6px; line-height:0;">- <img src="{{ assets | default('../assets', true) }}/logo-light.png" width="100" height="45" alt="AutoGPT" style="display:block; border:0;">- </td></tr>-{%- endmacro -%}--{%- macro hero_img(name, bgc, alt) -%}- <tr><td bgcolor="{{ bgc }}" align="center" style="padding:0; line-height:0; font-size:0;">- <img src="{{ assets | default('../assets', true) }}/otto-transparent-v1.png" width="160" height="160" alt="Otto, your personal Head of AI"- style="display:block; width:160px; max-width:100%; height:auto; border:0; outline:none; text-decoration:none;">- </td></tr>-{%- endmacro -%}--{# Per-email hero art. Each name maps to kit/assets/<name>.jpg and the- bgcolor is that image's own flat background, so blocked-image clients- show the same field of colour. #}-{%- set HEROES = {- 'welcome': ('hero-welcome', '#fef8f5', 'Otto beside a switch reading plan on, with three agent cards waking up'),- 'payment_hiccup': ('hero-payment-hiccup', '#f7f4fc', 'Otto holding a bank card with a small spark, beside a retry clock'),- 'final_notice': ('hero-final-notice', '#f7f4fa', 'Otto offering a bank card beside an almost-empty hourglass and a pausing agent'),- 'cancel_safe': ('hero-cancel-safe', '#f6f3f9', 'Otto filing agent cards into a storage box beside a calendar with one day circled'),- 'welcome_back': ('hero-welcome-back', '#fef9f6', 'Otto hugging an agent card inside a sweeping U-turn arrow'),- 'plan_asleep': ('hero-plan-asleep', '#f3eae6', 'Otto tucking agent cards under a blanket at dusk, a key glowing on the wall'),- 'trial_headsup': ('hero-trial-headsup', '#eae1f9', 'Otto tapping the third of three calendar cards beneath a clock'),- 'tour_firstwin': ('hero-tour-firstwin', '#e6ddf9', 'Otto fist-bumping a freshly completed agent card'),- 'tour_fiveways': ('hero-tour-fiveways', '#e7e1fa', 'Otto juggling five task cards, each with a different glyph'),- 'tour_workspace': ('hero-tour-workspace', '#eae2f7', 'Otto with a flag leading a tour past three framed workspace panels'),- 'tour_listening': ('hero-tour-listening', '#f6f4f2', 'Otto holding out an empty speech bubble, listening'),- 'tour_shipping': ('hero-tour-shipping', '#fef9f6', 'Otto at a conveyor ramp as feature crates ship out'),- 'tour_directline': ('hero-tour-directline', '#e6dffc', 'Otto waving, with dotted lines to a chat bubble, a form and a calendar'),- 'changelog': ('hero-changelog', '#fef9f6', 'Otto peering over an open box as new feature chips float out'),-} -%}--{%- macro hero(state) -%}-{%- set h = HEROES[state] -%}-{{ hero_img(h[0], h[1], h[2]) }}-{%- endmacro -%}--{%- macro strip_amber(text) -%}- <tr><td bgcolor="#fff6e8" class="gutter" style="padding:12px 48px; border-bottom:1px solid #f2dcb0;">- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:#b45309;">▲ {{ text }}</div>- </td></tr>-{%- endmacro -%}--{%- macro eyebrow(color='#575072', top=26) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:{{ color }};">{{ caller() }}</div>- </td></tr>-{%- endmacro -%}--{%- macro headline(top=8) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <div class="headline" style="font-size:26px; line-height:34px; font-weight:800; color:#070629; overflow-wrap:anywhere;">{{ caller() }}</div>- </td></tr>-{%- endmacro -%}--{%- macro para(top=16, color='#2d2a3e', size=15, lh=24) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <div style="font-size:{{ size }}px; line-height:{{ lh }}px; color:{{ color }};">{{ caller() }}</div>- </td></tr>-{%- endmacro -%}--{# rows: list of (label, value, mono) #}-{%- macro kvpanel(rows, top=18) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f3fb" style="border-radius:10px;">- <tr><td style="padding:14px 18px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- {%- for label, value, mono in rows %}- <tr>- <td width="150" valign="top" class="kvl{{ ' kvfirst' if loop.first }}" style="padding:{{ '0' if loop.first else '9px' }} 12px 9px 0; font-size:13px; color:#575072; border-top:{{ '0' if loop.first else '1px solid #e7e4f4' }};">{{ label }}</td>- <td valign="top" align="right" class="kvv" style="padding:{{ '0' if loop.first else '9px' }} 0 9px; {% if mono %}font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px;{% else %}font-size:13px;{% endif %} color:#070629; border-top:{{ '0' if loop.first else '1px solid #e7e4f4' }}; overflow-wrap:anywhere;">{{ value }}</td>- </tr>- {%- endfor %}- </table>- </td></tr>- </table>- </td></tr>-{%- endmacro -%}--{# tone: 'amber' | 'neutral' #}-{%- macro note_card(label, tone='neutral', top=20) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ '#fff6e8' if tone == 'amber' else '#f5f3fb' }}" style="border:1px solid {{ '#f2dcb0' if tone == 'amber' else '#e7e4f4' }}; border-left:4px solid {{ '#e8940a' if tone == 'amber' else '#7c5cd6' }}; border-radius:10px;">- <tr><td style="padding:16px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:{{ '#8a5800' if tone == 'amber' else '#575072' }}; padding-bottom:7px;">{{ label | upper }}</div>- <div style="font-size:15px; line-height:24px; color:#2d2a3e; overflow-wrap:anywhere;">{{ caller() }}</div>- </td></tr>- </table>- </td></tr>-{%- endmacro -%}--{# items: list of (strong, text, link_label, url) #}-{%- macro also_panel(label, items, top=28) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f3fb" style="border-radius:10px;">- <tr><td style="padding:15px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#575072; padding-bottom:5px;">{{ label | upper }}</div>- {%- for strong, text, link_label, url in items %}- <div style="font-size:14px; line-height:21px; color:#2d2a3e;{{ ' padding-top:8px;' if not loop.first }}">- <strong style="color:#070629;">{{ strong }}</strong> {{ text }}- <a href="{{ url }}" style="color:#5635b2; font-weight:700; text-decoration:underline;">{{ link_label }}</a>- </div>- {%- endfor %}- </td></tr>- </table>- </td></tr>-{%- endmacro -%}--{# items: list of (lead, rest) — lead is bolded #}-{%- macro steps(items, top=18) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- {%- for lead, rest in items %}- <tr>- <td width="26" valign="top" style="font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:22px; font-weight:bold; color:#5635b2; padding-bottom:{{ '0' if loop.last else '12px' }};">{{ loop.index }}</td>- <td valign="top" style="font-size:14px; line-height:22px; color:#2d2a3e; padding-bottom:{{ '0' if loop.last else '12px' }};"><strong style="color:#070629;">{{ lead }}</strong> {{ rest }}</td>- </tr>- {%- endfor %}- </table>- </td></tr>-{%- endmacro -%}--{%- macro cta(label, url, micro=none, top=24) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" cellpadding="0" cellspacing="0" border="0">- <tr><td bgcolor="#5635b2" style="border-radius:8px;">- <a href="{{ url }}" style="display:inline-block; padding:13px 28px; font-size:15px; font-weight:700; color:#ffffff;">{{ label }}</a>- </td></tr>- </table>- {%- if micro %}- <div style="padding-top:10px; font-size:12px; color:#575072;">{{ micro }}</div>- {%- endif %}- </td></tr>-{%- endmacro -%}--{%- macro close_row(text, link_label, url) -%}- <tr><td align="center" class="gutter" style="padding:22px 48px 24px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr><td height="1" bgcolor="#eeecf5" style="font-size:0; line-height:0;"> </td></tr>- <tr><td align="center" style="padding-top:12px; font-size:12px; line-height:19px; color:#575072;">- {{ text }}<div style="padding-top:4px;"><a href="{{ url }}" style="color:#5635b2; text-decoration:underline;">{{ link_label }}</a></div>- </td></tr>- </table>- </td></tr>-{%- endmacro -%}--{%- macro legal_footer(first_line, link_label, link_url, discord=false) -%}- <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" class="sheet" style="width:560px; max-width:560px;">- <tr><td align="center" style="padding:18px 24px 0; font-size:11px; line-height:18px; color:#575072;">- {{ first_line }}<br>- Legally, we have to tell you where we live: <a href="https://agpt.co" style="color:#5635b2; text-decoration:underline;">AutoGPT</a>, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK · - <a href="{{ link_url }}" style="color:#575072; text-decoration:underline;">{{ link_label }}</a>{% if discord %} · - <a href="https://discord.gg/autogpt" style="color:#575072; text-decoration:underline;">Discord</a>{% endif %}- </td></tr>- </table>-{%- endmacro -%}--{%- macro signature(name, title, email=none, top=26) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <div style="font-size:14px; font-weight:700; color:#070629;">{{ name }}</div>- <div style="font-size:13px; line-height:20px; color:#575072;">{{ title }}</div>- {%- if email %}- <div style="font-size:13px; line-height:20px;"><a href="mailto:{{ email }}" style="color:#5635b2; text-decoration:underline;">{{ email }}</a></div>- {%- endif %}- </td></tr>-{%- endmacro -%}--{# small card list with emoji lead — one panel per item #}-{%- macro emoji_cards(items, top=20) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- {%- for emoji, title, body in items %}- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f3fb" style="border-radius:10px;{{ ' margin-top:10px;' if not loop.first }}">- <tr><td style="padding:13px 16px;">- <div style="font-size:14px; font-weight:700; color:#070629;">{{ emoji }} {{ title }}</div>- <div style="font-size:13.5px; line-height:21px; color:#2d2a3e; padding-top:3px;">{{ body }}</div>- </td></tr>- </table>- {%- endfor %}- </td></tr>-{%- endmacro -%}--{# video / media link row #}-{%- macro media_link(label, sub, url, top=20) -%}- <tr><td class="gutter" style="padding:{{ top }}px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f3fb" style="border-radius:10px;">- <tr><td style="padding:13px 16px;">- <div style="font-size:14px; font-weight:700;"><a href="{{ url }}" style="color:#5635b2; text-decoration:underline;">▶ {{ label }}</a></div>- <div style="font-size:13px; line-height:20px; color:#575072; padding-top:2px;">{{ sub }}</div>- </td></tr>- </table>- </td></tr>-{%- endmacro -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/_trial_copy.j2 b/autogpt_platform/backend/backend/notifications/templates/_trial_copy.j2new file mode 100644index 0000000000..983b80a055--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/templates/_trial_copy.j2@@ -0,0 +1,6 @@+{% macro lede() -%}+Hi {{ user_name }}, {% if kind == 'started' %}your card is set up and your trial is ready.{% elif kind == 'ending' %}your trial ends on {{ ends_label }}.{% elif kind == 'canceled' %}your trial will not convert to a paid plan.{% elif kind == 'resumed' %}your trial cancellation has been removed.{% elif kind == 'converted' %}your trial has ended, your payment is confirmed, and your {{ plan.name }} plan is active.{% elif kind == 'payment_failed' %}we couldn't complete the payment after your trial.{% else %}your trial access has ended.{% endif %} {{ preheader }}+{%- endmacro %}+{% macro detail() -%}+{% if kind == 'started' %}Pick a real task, connect the accounts it needs, and give AutoGPT a first run. Unless you cancel before {{ ends_label }}, your plan starts automatically at {{ plan.price_display }}. Applicable tax may be added. Trial access is subject to your trial allowance.{% elif kind in ['ending', 'resumed'] %}Applicable tax may be added. Review your plan or cancel in billing settings before {{ ends_label }}.{% elif kind == 'payment_failed' %}Update your card or complete any verification requested by your bank in billing settings.{% elif kind == 'ended' %}Review your plan and payment status in billing settings if you'd like to continue.{% endif %}+{%- endmacro %}diff --git a/autogpt_platform/backend/backend/notifications/templates/_ui.j2 b/autogpt_platform/backend/backend/notifications/templates/_ui.j2deleted file mode 100644index 9634162677..0000000000--- a/autogpt_platform/backend/backend/notifications/templates/_ui.j2+++ /dev/null@@ -1,228 +0,0 @@-{# ============================================================- _ui.j2 — shared components for AutoGPT notification emails- All macros emit table-based, inline-styled, email-safe HTML.- Hero art is hosted images (see hero_img). Pass `assets` in the- render context as the base URL those images are served from.- ============================================================ #}--{%- macro page_open() -%}-<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f1efe9">-<tr><td align="center" style="padding:32px 12px 44px;">- <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" class="sheet" style="width:560px; max-width:560px;">-{%- endmacro -%}--{%- macro page_close() -%}- </table>-{%- endmacro -%}--{%- macro head_block(title_text) -%}-<meta charset="utf-8">-<meta name="viewport" content="width=device-width, initial-scale=1">-<meta name="color-scheme" content="light">-<title>{{ title_text }}</title>-<style>- html, body { margin:0 !important; padding:0 !important; width:100% !important; }- table { border-collapse:collapse; }- a { text-decoration:none; }- @media only screen and (max-width: 600px) {- .sheet { width:100% !important; }- .gutter { padding-left:22px !important; padding-right:22px !important; }- .headline { font-size:23px !important; line-height:31px !important; }- .sum { font-size:10px !important; letter-spacing:0 !important; }- .mobile-hide { display:none !important; }- .kvl { display:block !important; width:100% !important; padding:10px 0 2px !important; border-top:1px solid #e7e4f4 !important; }- .kvv { display:block !important; width:100% !important; text-align:left !important; padding:0 0 10px !important; border-top:0 !important; font-size:11px !important; }- .kvfirst { border-top:0 !important; padding-top:0 !important; }- }-</style>-{%- endmacro -%}--{%- macro preheader(text) -%}-<div style="display:none; font-size:1px; color:#f1efe9; line-height:1px; max-height:0; overflow:hidden;">- {{ text }} ‌ ‌ ‌ ‌ ‌-</div>-{%- endmacro -%}--{%- macro header() -%}- <tr><td bgcolor="#0b0a14" align="center" style="border-radius:14px 14px 0 0; padding:19px 0 17px;">- <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>- <td style="padding-right:9px; line-height:0;">- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">- <path d="M5 20 L12 3 L19 20" stroke="#ffffff" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" fill="none"/>- <circle cx="12" cy="3.4" r="2.6" fill="#8b5cf6"/>- <circle cx="5" cy="20" r="2.6" fill="#ffffff"/>- <circle cx="19" cy="20" r="2.6" fill="#ffffff"/>- </svg>- </td>- <td style="font-size:19px; font-weight:800; color:#ffffff; letter-spacing:-0.2px; line-height:24px; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">AutoGPT</td>- </tr></table>- </td></tr>-{%- endmacro -%}--{# ---------------------------------------------------------------- Hero art. Hosted images, not inline SVG: Outlook does not render- inline SVG at all. `assets` comes from the render context (see- README); the td keeps a bgcolor matching the art so a blocked- image still leaves the right colour band behind the card.- --------------------------------------------------------------- #}-{%- macro hero_img(name, bgc, alt) -%}- <tr><td bgcolor="{{ bgc }}" align="center" style="padding:0; line-height:0; font-size:0;">- <img src="{{ assets | default('https://platform.agpt.co/email', true) }}/otto-transparent-v1.png"- width="160" height="160" alt="Otto, your personal Head of AI"- style="display:block; width:160px; max-width:100%; height:auto; border:0; outline:none; text-decoration:none;">- </td></tr>-{%- endmacro -%}--{# Briefing hero. state: 'clean' | 'attention' | 'rough' | 'quiet' #}-{%- macro hero_briefing(state) -%}-{%- if state == 'quiet' -%}-{{ hero_img('hero-briefing-quiet', '#f0f0ee', 'Otto asleep beside a mug and a crescent moon') }}-{%- elif state == 'rough' -%}-{{ hero_img('hero-briefing-rough', '#eae1f5', 'Otto looking unhappy between a flagged and a failed document') }}-{%- elif state == 'attention' -%}-{{ hero_img('hero-briefing-attention', '#e6def7', 'Otto beside one flagged document and one completed one') }}-{%- else -%}-{{ hero_img('hero-briefing-clean', '#e7e0f8', 'Otto smiling between two completed documents') }}-{%- endif -%}-{%- endmacro -%}--{# Verdict hero. state: 'approved' | 'changes' #}-{%- macro hero_verdict(state) -%}-{%- if state == 'approved' -%}-{{ hero_img('hero-verdict-approved', '#fcf9f6', 'Otto celebrating beside an approval rosette') }}-{%- else -%}-{{ hero_img('hero-verdict-changes', '#f9f4f5', 'Otto considering a clipboard of review notes') }}-{%- endif -%}-{%- endmacro -%}--{%- macro hero_alert() -%}-{{ hero_img('hero-alert', '#f7f4fb', 'Otto looking startled above an unplugged cable') }}-{%- endmacro -%}--{%- macro btn(label, url) -%}- <table role="presentation" cellpadding="0" cellspacing="0" border="0">- <tr><td bgcolor="#5d23bb" style="border-radius:8px;">- <a href="{{ url }}" style="display:inline-block; padding:13px 28px; font-size:15px; font-weight:700; color:#ffffff;">{{ label }}</a>- </td></tr>- </table>-{%- endmacro -%}--{%- macro btn_small(label, url) -%}- <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#5d23bb" style="border-radius:6px;">- <a href="{{ url }}" style="display:inline-block; padding:8px 14px; font-size:13px; font-weight:700; color:#ffffff;">{{ label }}</a>- </td></tr></table>-{%- endmacro -%}--{%- macro trunc(s, n=40) -%}-{%- if s | length <= n -%}{{ s }}-{%- else -%}-{%- set cut = s[:n-1] -%}-{%- set sp = cut.rfind(' ') -%}-{%- set base = cut[:sp] if sp > ((n * 6) // 10) else cut -%}-{%- set base = base | trim(' (&–—-·:,;') -%}-{#- never leave an unmatched opening bracket dangling before the ellipsis -#}-{%- if base.count('(') > base.count(')') -%}-{%- set base = base[:base.rfind('(')] | trim(' (&–—-·:,;') -%}-{%- endif -%}-{%- if base.count('“') > base.count('”') -%}-{%- set base = base[:base.rfind('“')] | trim(' (&“"–—-·:,;') -%}-{%- endif -%}-{{- base ~ '…' -}}-{%- endif -%}-{%- endmacro -%}--{%- macro attention_card(item, primary=true) -%}- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#fff6e8" style="border:1px solid #f2dcb0; border-left:4px solid {{ '#e8940a' if primary else '#f0cf9a' }}; border-radius:10px;">- <tr><td style="padding:16px 18px;">- <div style="font-size:15px; font-weight:700; color:#17123b;">- <span style="color:#b45309;">▲</span> {{ trunc(item.title, 52) }}{% if item.tag %} <span style="font-size:11px; font-weight:800; letter-spacing:1px; color:#b45309; white-space:nowrap;">{{ item.tag|upper }}</span>{% endif %}- </div>- <div style="padding-top:5px; font-size:14px; line-height:21px; color:#5d5872;">- {{ item.body }}- </div>- <div style="padding-top:11px;">- {{ btn_small(item.cta_label, item.cta_url) }}- </div>- </td></tr>- </table>-{%- endmacro -%}--{%- macro section_label(text, color='#8a86a3') -%}- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:{{ color }};">{{ text }}</div>-{%- endmacro -%}--{%- macro legal_footer(first_line, unsubscribe_url, discord=true) -%}- <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" class="sheet" style="width:560px; max-width:560px;">- <tr><td align="center" style="padding:18px 24px 0; font-size:11px; line-height:18px; color:#9b97ad;">- {{ first_line }}<br>- Legally, we have to tell you where we live: <a href="https://agpt.co" style="color:#6d28d9; text-decoration:underline;">AutoGPT</a>, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK · - <a href="{{ unsubscribe_url }}" style="color:#9b97ad; text-decoration:underline;">Unsubscribe</a>{% if discord %} · - <a href="https://discord.gg/autogpt" style="color:#9b97ad; text-decoration:underline;">Discord</a>{% endif %}- </td></tr>- </table>-{%- endmacro -%}----{# Quoted note / feedback card. tone: 'amber' | 'neutral' #}-{%- macro note_card(label, body, tone='neutral') -%}- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{ '#fff6e8' if tone == 'amber' else '#f7f6fc' }}" style="border:1px solid {{ '#f2dcb0' if tone == 'amber' else '#e7e4f4' }}; border-left:4px solid {{ '#e8940a' if tone == 'amber' else '#8b5cf6' }}; border-radius:10px;">- <tr><td style="padding:16px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:{{ '#8a5800' if tone == 'amber' else '#6f6b8a' }}; padding-bottom:7px;">{{ label|upper }}</div>- <div style="font-size:15px; line-height:24px; color:#3b3757; overflow-wrap:anywhere;">{{ body }}</div>- </td></tr>- </table>-{%- endmacro -%}--{# Numbered step, used for "how to resubmit" / "how to reject" #}-{%- macro step(n, text) -%}- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr>- <td width="26" valign="top" style="font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:22px; font-weight:bold; color:#8b5cf6;">{{ n }}</td>- <td style="font-size:14px; line-height:22px; color:#494566;">{{ text }}</td>- </tr>- </table>-{%- endmacro -%}--{# Compact ops band: big amount + status chip + small mascot. Internal emails- don't get a 184px hero — the number is the hero. #}-{%- macro ops_band(eyebrow, amount_text, sub_text, status_label, status_bg) -%}- <tr><td bgcolor="#1c1a2e" style="padding:20px 30px 22px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr>- <td valign="middle">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#9a95b8;">{{ eyebrow }}</div>- <div style="padding-top:6px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:32px; font-weight:bold; color:#ffffff; letter-spacing:-0.5px;">{{ amount_text }}</div>- <div style="padding-top:5px; font-size:13px; line-height:19px; color:#b8b3d1; overflow-wrap:anywhere;">{{ sub_text }}</div>- <div style="padding-top:11px;">- <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>- <td bgcolor="{{ status_bg }}" style="border-radius:4px; padding:5px 10px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px; font-weight:bold; letter-spacing:1.4px; color:#1c1a2e;">{{ status_label|upper }}</td>- </tr></table>- </div>- </td>- <td width="118" align="right" valign="middle" class="mobile-hide" style="line-height:0; font-size:0;">- <img src="{{ assets | default('https://platform.agpt.co/email', true) }}/otto-transparent-v1.png"- width="80" height="80" alt=""- style="display:block; border:0; outline:none; text-decoration:none;">- </td>- </tr>- </table>- </td></tr>-{%- endmacro -%}--{# Key/value ledger row for ops emails #}-{%- macro kv(label, value, mono=true, first=false) -%}- <tr>- <td width="150" valign="top" class="kvl{{ ' kvfirst' if first }}" style="padding:{{ '0' if first else '9px' }} 12px 9px 0; font-size:13px; color:#8a86a3; border-top:{{ '0' if first else '1px solid #e7e4f4' }};">{{ label }}</td>- <td valign="top" align="right" class="kvv" style="padding:{{ '0' if first else '9px' }} 0 9px; {% if mono %}font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px;{% else %}font-size:13px;{% endif %} color:#17123b; border-top:{{ '0' if first else '1px solid #e7e4f4' }}; overflow-wrap:anywhere;">{{ value }}</td>- </tr>-{%- endmacro -%}--{# Internal footer — no marketing chrome, no unsubscribe (ops mail is not opt-in) #}-{%- macro internal_footer(line) -%}- <table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" class="sheet" style="width:560px; max-width:560px;">- <tr><td align="center" style="padding:18px 24px 0; font-size:11px; line-height:18px; color:#9b97ad;">- {{ line }}- </td></tr>- </table>-{%- endmacro -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/alert.html.j2 b/autogpt_platform/backend/backend/notifications/templates/alert.html.j2index 16de105da1..4beaf2f51d 100644--- a/autogpt_platform/backend/backend/notifications/templates/alert.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/alert.html.j2@@ -1,102 +1,37 @@-{#- ============================================================- alert.html.j2 — the "Needs you" interrupt- One template covers every alert cause (auth expired, agent- paused, awaiting review, low balance, spend guardrail) plus- coalesced secondary items. All strings arrive pre-assembled- from the cause catalog (see README.md).- ============================================================ -#}-{%- import "_ui.j2" as ui with context -%}+{%- import "_email_ui.j2" as ui with context -%}{%- set also_items = also | default([]) -%}<!doctype html><html lang="en">-<head>-{{ ui.head_block(subject | default(primary.headline)) }}-</head>-<body style="margin:0; padding:0; background-color:#f1efe9; -webkit-text-size-adjust:100%; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">-{{ ui.preheader(preheader | default(primary.body)) }}+<head>{{ ui.head_block(subject) }}</head>+{{ ui.body_open() }}+{{ ui.preheader(preheader) }}{{ ui.page_open() }}-{{ ui.header() }}-{{ ui.hero_alert() }}-- <!-- Body card -->- <tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-- {#- a tinted severity strip, so the alert still reads as an alert with images off -#}- <tr><td bgcolor="#fff6e8" class="gutter" style="padding:12px 48px; border-bottom:1px solid #f2dcb0;">- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:#b45309;">▲ NEEDS YOU{% if timestamp_label %} · {{ timestamp_label | upper }}{% endif %}</div>- </td></tr>- <tr><td class="gutter" style="padding:26px 48px 0;">- <div class="headline" style="font-size:26px; line-height:34px; font-weight:800; color:#17123b; overflow-wrap:anywhere;">- {{ primary.headline }}- </div>- </td></tr>-- <tr><td class="gutter" style="padding:16px 48px 0;">- <div style="font-size:15px; line-height:24px; color:#494566;">- {{ primary.body }}- </div>- </td></tr>-- {%- if primary.facts %}- <tr><td class="gutter" style="padding:18px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:14px 18px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- {%- for f in primary.facts %}- {{ ui.kv(f.label, f.value, mono=true, first=loop.first) }}- {%- endfor %}- </table>- </td></tr>- </table>- </td></tr>- {%- endif %}-- <tr><td class="gutter" style="padding:24px 48px 0;">- {{ ui.btn(primary.cta_label, primary.cta_url) }}- {%- if primary.microcopy %}- <div style="padding-top:10px; font-size:12px; color:#8a86a3;">{{ primary.microcopy }}</div>- {%- endif %}- </td></tr>-- {%- if also_items %}- <tr><td class="gutter" style="padding:28px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:15px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#6f6b8a; padding-bottom:5px;">{{ (also_label | default('Also waiting')) | upper }}</div>- {%- for a in also_items[:3] %}- <div style="font-size:14px; line-height:21px; color:#494566;{{ ' padding-top:8px;' if not loop.first }}">- <strong style="color:#17123b;">{{ ui.trunc(a.agent, 44) }}</strong> {{ a.text }}- <a href="{{ a.url }}" style="color:#6d28d9; font-weight:700; text-decoration:underline;">{{ a.link_label }}</a>- </div>- {%- endfor %}- {%- if also_items | length > 3 %}- <div style="font-size:13px; line-height:20px; color:#8a86a3; padding-top:8px;">- + {{ also_items | length - 3 }} more waiting —- <a href="{{ urls.dashboard }}" style="color:#6d28d9; font-weight:700; text-decoration:underline;">open your dashboard</a>- </div>- {%- endif %}- </td></tr>- </table>- </td></tr>- {%- endif %}-- <tr><td align="center" class="gutter" style="padding:22px 48px 24px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr><td height="1" bgcolor="#eeecf5" style="font-size:0; line-height:0;"> </td></tr>- <tr><td align="center" style="padding-top:12px; font-size:12px; line-height:19px; color:#8a86a3;">- Alerts only fire when your action is needed — never for a successful run.- <div style="padding-top:4px;"><a href="{{ urls.settings }}" style="color:#6d28d9; text-decoration:underline;">Alert settings</a></div>- </td></tr>- </table>- </td></tr>-- </table>- </td></tr>+{{ ui.masthead() }}+{{ ui.hero_otto() }}+{{ ui.sheet_open() }}+{{ ui.strip_amber('NEEDS YOU' ~ (' · ' ~ timestamp_label | upper if timestamp_label else '')) }}+{% call ui.eyebrow(tone='needs_you') %}THE ALERT{% endcall %}+{% call ui.headline() %}{{ primary.headline }}{% endcall %}+{% call ui.para() %}Hi {{ first_name | default('there', true) }}, here is what needs your attention. {{ preheader }}{% endcall %}+{% set detail = primary.body[preheader | length:] | trim if primary.body.startswith(preheader) else primary.body %}+<tr><td class="gutter" style="padding:22px 48px 0;">{{ ui.attention_card({'title': primary.headline, 'body': detail, 'cta_label': primary.cta_label, 'cta_url': primary.cta_url}) }}</td></tr>+{% if primary.microcopy %}{% call ui.para(top=10, size=12, lh=18, color='#575072') %}{{ primary.microcopy }}{% endcall %}{% endif %}+{% if primary.facts %}+{% set rows = [] %}+{% for f in primary.facts %}{% set _ = rows.append((f.label, f.value, true)) %}{% endfor %}+{{ ui.kvpanel(rows) }}+{% endif %}+{% if also_items %}+{% set rows = [] %}+{% for a in also_items[:3] %}{% set _ = rows.append((a.agent, a.text, a.link_label, a.url)) %}{% endfor %}+{{ ui.also_panel(also_label | default('Also waiting', true), rows) }}+{% if also_items | length > 3 %}+{% call ui.para(size=14, lh=21) %}+ {{ also_items | length - 3 }} more waiting. <a href="{{ urls.dashboard }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">Review all workflows</a>{% endcall %}+{% endif %}+{% endif %}+{{ ui.close_row('You get this alert because your action is needed.', 'Alert settings', urls.settings) }}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{{ ui.legal_footer('This alert is about the AutoGPT account for ' ~ user_email ~ '.', urls.unsubscribe, discord=false) }}--</td></tr>-</table>-</body>-</html>+{{ ui.product_footer('This is a product notification for the AutoGPT account for ' ~ user_email ~ '.', urls.unsubscribe) }}+</td></tr></table>+</body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/alert.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/alert.txt.j2index 8ba9d1a2d0..d170c8409c 100644--- a/autogpt_platform/backend/backend/notifications/templates/alert.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/alert.txt.j2@@ -1,11 +1,15 @@{#- Plain-text part of the Alert, built from the same context as the HTML. -#}{%- set also_items = also | default([]) -%}-NEEDS YOU{% if timestamp_label %} - {{ timestamp_label }}{% endif %}+NEEDS YOU{% if timestamp_label %} · {{ timestamp_label }}{% endif %}{{ primary.headline }}-{{ primary.body }}+Hi {{ first_name | default('there', true) }}, here is what needs your attention. {{ preheader }}+{% set detail = primary.body[preheader | length:] | trim if primary.body.startswith(preheader) else primary.body %}+{% if detail %}+{{ detail }}+{% endif %}{% if primary.facts %}{% for f in primary.facts %}{{ f.label }}: {{ f.value }}@@ -29,9 +33,11 @@ NEEDS YOU{% if timestamp_label %} - {{ timestamp_label }}{% endif %}{% endif %}---Alerts only fire when your action is needed - never for a successful run.+You get this alert because your action is needed.Alert settings: {{ urls.settings }}-This alert is about the AutoGPT account for {{ user_email }}.+This is a product notification for the AutoGPT account for {{ user_email }}.+AutoGPT: https://agpt.coAutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKUnsubscribe: {{ urls.unsubscribe }}+Discord: {{ urls.discord }}diff --git a/autogpt_platform/backend/backend/notifications/templates/auth.html.j2 b/autogpt_platform/backend/backend/notifications/templates/auth.html.j2new file mode 100644index 0000000000..c4f4f7f842--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/templates/auth.html.j2@@ -0,0 +1,22 @@+{% import '_email_ui.j2' as ui with context %}+<!doctype html>+<html lang="en">+<head>{{ ui.head_block(content.subject) }}</head>+{{ ui.body_open() }}+{{ ui.preheader(content.preheader) }}+{{ ui.page_open() }}+{{ ui.masthead() }}+{{ ui.sheet_open() }}+{% call ui.eyebrow(top=28) %}{{ content.eyebrow }}{% endcall %}+{% call ui.headline() %}{{ content.headline }}{% endcall %}+{% call ui.para() %}{{ content.intro }} {{ content.preheader }} If you didn't request this, you can safely ignore this email.{% endcall %}+{{ ui.cta(content.action, action_url, micro='Button not working? Copy this link into your browser:') }}+{% call ui.para(top=6, size=12, lh=18) %}+<a href="{{ action_url }}" style="color:#4D36AD; text-decoration:underline; font-family:{{ ui.MONO }}; font-size:12px; overflow-wrap:anywhere; word-break:break-word;">{{ action_url }}</a>+{% endcall %}+{{ ui.close_row(content.reason, 'Something wrong? Ask in Discord', urls.discord) }}+{{ ui.sheet_close() }}+{{ ui.page_close() }}+{{ ui.legal_footer("This is a service message about an AutoGPT account. It's sent even if you've opted out of product news.", 'Discord', urls.discord) }}+</td></tr></table>+</body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/auth.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/auth.txt.j2new file mode 100644index 0000000000..4549ec1c89--- /dev/null+++ b/autogpt_platform/backend/backend/notifications/templates/auth.txt.j2@@ -0,0 +1,14 @@+{{ content.headline }}++{{ content.intro }} {{ content.preheader }} If you didn't request this, you can safely ignore this email.++{{ content.action }}:+{{ action_url }}++{{ content.reason }}+Something wrong? Ask in Discord: {{ urls.discord }}++This is a service message about an AutoGPT account. It's sent even if you've opted out of product news.+AutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UK+https://agpt.co+Discord: {{ urls.discord }}diff --git a/autogpt_platform/backend/backend/notifications/templates/briefing.html.j2 b/autogpt_platform/backend/backend/notifications/templates/briefing.html.j2index f1ec3c32b8..44284bf2aa 100644--- a/autogpt_platform/backend/backend/notifications/templates/briefing.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/briefing.html.j2@@ -1,218 +1,54 @@-{#- ============================================================- briefing.html.j2 — the Agent Briefing digest (weekly or daily)- One template covers busy, clean, rough, and quiet periods.- See README.md for the full context schema.- Render briefing.subject.j2 first and pass `subject` and- `preheader` in; both fall back safely if omitted.- ============================================================ -#}-{%- import "_ui.j2" as ui with context -%}--{#- ---------- derived values ---------- -#}-{%- set runs = totals.runs -%}-{%- set failed = totals.failed | default(0) -%}+{%- import "_email_ui.j2" as ui with context -%}+{%- set quiet = mode | default('standard') == 'quiet' -%}{%- set attn = attention | default([]) -%}-{%- set attn_count = attn | length -%}-{%- set agents_total = totals.agents_active + (totals.agents_idle | default(0)) -%}-{%- set runs_fmt = '{:,}'.format(runs) -%}-{%- set run_word = 'run' if runs == 1 else 'runs' -%}-{%- set times_phrase = 'once' if runs == 1 else runs_fmt ~ ' times' -%}-{%- set nw = {1:'one', 2:'two', 3:'three', 4:'four', 5:'five', 6:'six', 7:'seven', 8:'eight', 9:'nine'} -%}-{%- set quiet = (mode | default('standard')) == 'quiet' -%}-{%- set bad_period = (not quiet) and runs > 0 and failed >= 3 and failed * 3 >= runs -%}--{#- ---------- headline ---------- -#}-{%- if quiet -%}- {%- set headline = 'A quiet ' ~ period.adjective ~ ' — in a good way' -%}-{%- elif bad_period -%}- {%- set headline = 'A rough ' ~ period.adjective ~ ': ' ~ failed ~ ' of ' ~ runs_fmt ~ ' runs failed' -%}-{%- elif attn_count == 1 -%}- {%- set headline = runs_fmt ~ ' ' ~ run_word ~ ', and only one thing needs you' -%}-{%- elif attn_count > 0 and attn_count <= 3 -%}- {%- set headline = runs_fmt ~ ' ' ~ run_word ~ ', and only ' ~ nw[attn_count] ~ ' things need you' -%}-{%- elif attn_count > 3 -%}- {%- set headline = runs_fmt ~ ' ' ~ run_word ~ ' — ' ~ attn_count ~ ' things need you' -%}-{%- elif failed > 0 -%}- {%- set headline = runs_fmt ~ ' ' ~ run_word ~ ', ' ~ failed ~ ' failed — nothing blocked on you' -%}-{%- else -%}- {%- set headline = 'All clear: ' ~ runs_fmt ~ ' ' ~ run_word ~ ', nothing needed you' -%}-{%- endif -%}+{%- set failed = totals.failed | default(0) -%}<!doctype html><html lang="en">-<head>-{{ ui.head_block(subject | default(headline)) }}-</head>-<body style="margin:0; padding:0; background-color:#f1efe9; -webkit-text-size-adjust:100%; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">-{{ ui.preheader(preheader | default('Your agents’ ' ~ period.adjective ~ ' at a glance.')) }}+<head>{{ ui.head_block(subject) }}</head>+{{ ui.body_open() }}+{{ ui.preheader(preheader) }}{{ ui.page_open() }}-{{ ui.header() }}-{{ ui.hero_briefing('quiet' if quiet else ('rough' if bad_period else ('attention' if attn_count > 0 else 'clean'))) }}-- <!-- Body card -->- <tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-- <tr><td class="gutter" style="padding:30px 48px 0;">- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:#6d28d9;">YOUR {{ {'daily':'DAY','weekly':'WEEK','monthly':'MONTH'}.get(period.frequency, 'WEEK') }} IN AGENTS · {{ period.label | upper }}</div>- <div class="headline" style="padding-top:10px; font-size:26px; line-height:34px; font-weight:800; color:#17123b;">- {{ headline }}- </div>- </td></tr>-- <tr><td class="gutter" style="padding:16px 48px 0;">- <div style="font-size:15px; line-height:24px; color:#494566;">- {%- if quiet %}- {%- if only_agent %}- {{ only_agent }} was your only agent at work {{ period.noun }}.- {{ quiet_summary | default('It ran ' ~ times_phrase ~ ', and nothing needed your attention.') }}- {%- else %}- A light {{ period.adjective }}: {{ totals.agents_active }} agents ran <strong>{{ times_phrase }}</strong>, and nothing needed your attention.- {%- endif %}- {%- else %}- {#- the lede counts agents that actually ran; ledger lists exactly those -#}- {%- if totals.agents_active == 1 %}- Your agent ran <strong>{{ times_phrase }}</strong> {{ period.noun }}- {%- else %}- Your {{ nw.get(totals.agents_active, '{:,}'.format(totals.agents_active)) }} agents ran <strong>{{ times_phrase }}</strong> {{ period.noun }}- {%- endif %}- {%- if failed == 0 %}{{ ', and it finished clean.' if runs == 1 else ', and every run finished clean.' }}- {%- elif failed == runs %}{{ ', and it failed.' if runs == 1 else ', and none of them finished clean.' }}- {%- elif failed == 1 %} — all but one finished clean.- {%- else %} — all but {{ failed }} finished clean.- {%- endif %}- {%- if standout %} {{ standout }}{% endif %}- {%- if attn_count == 1 %} One agent is waiting on you before it can carry on.- {%- elif attn_count in [2, 3] %} {{ nw[attn_count] | capitalize }} agents are waiting on you before they can carry on.- {%- elif attn_count > 3 %} You have {{ attn_count }} things waiting on you before they can carry on.- {%- endif %}- {%- endif %}- </div>- </td></tr>-- {%- for item in attn[:3] %}- <tr><td class="gutter" style="padding:{{ '22px' if loop.first else '12px' }} 48px 0;">- {{ ui.attention_card(item, primary=loop.first) }}- </td></tr>- {%- endfor %}- {%- if attn_count > 3 %}- <tr><td class="gutter" style="padding:12px 48px 0;">- <div style="font-size:13px; line-height:20px; color:#8a5800;">- ▲ + {{ attn_count - 3 }} more {{ 'thing needs' if attn_count - 3 == 1 else 'things need' }} you —- <a href="{{ urls.attention | default(urls.dashboard) }}" style="color:#6d28d9; font-weight:700; text-decoration:underline;">see everything waiting</a>- </div>- </td></tr>- {%- endif %}-- {%- if highlights %}- <tr><td class="gutter" style="padding:30px 48px 0;">- {{ ui.section_label('WORTH A LOOK') }}- </td></tr>- {%- for h in highlights[:3] %}- <tr><td class="gutter" style="padding:{{ '14px' if loop.first else '12px' }} 48px 0;">- <div style="font-size:15px; line-height:23px; color:#494566;">- <strong style="color:#17123b;">{{ ui.trunc(h.agent, 44) }}</strong> {{ h.gist }}- <a href="{{ h.url }}" style="color:#6d28d9; font-weight:700; text-decoration:underline;">{{ h.link_label | default('See the run') }}</a>- </div>- </td></tr>- {%- endfor %}- {%- endif %}-- {%- if not quiet %}- <tr><td class="gutter" style="padding:30px 48px 0;">- {{ ui.section_label('THE LEDGER') }}- </td></tr>- <tr><td class="gutter" style="padding:12px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:6px 18px 12px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr>- <td style="padding:9px 0 6px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px; letter-spacing:1px; color:#8a86a3;">AGENT</td>- <td align="right" style="padding:9px 0 6px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px; letter-spacing:1px; color:#8a86a3;">RUNS</td>- <td align="right" style="padding:9px 0 6px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px; letter-spacing:1px; color:#8a86a3;">ISSUES</td>- <td align="right" style="padding:9px 0 6px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px; letter-spacing:1px; color:#8a86a3;">CREDITS</td>- </tr>- {%- for row in ledger %}- <tr>- <td style="padding:8px 8px 8px 0; font-size:14px; color:#17123b; border-top:1px solid #e7e4f4; overflow-wrap:anywhere;">{{ ui.trunc(row.agent, 34) }}</td>- <td align="right" style="padding:8px 0 8px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; color:#17123b; border-top:1px solid #e7e4f4;">{{ '{:,}'.format(row.runs) }}</td>- {%- if row.issues_label %}- <td align="right" style="padding:8px 0 8px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; color:{{ '#b91c1c' if row.issues_kind == 'fail' else '#b45309' }}; border-top:1px solid #e7e4f4;">{{ row.issues_label }}</td>- {%- else %}- <td align="right" style="padding:8px 0 8px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; color:#b5b1c9; border-top:1px solid #e7e4f4;">—</td>- {%- endif %}- <td align="right" style="padding:8px 0 8px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; color:#17123b; border-top:1px solid #e7e4f4;">{{ '%.2f' | format(row.credits) }}</td>- </tr>- {%- endfor %}- {%- if ledger_overflow %}- {%- set rest_runs = ledger_overflow_runs %}- {%- set rest_issues = ledger_overflow_issues %}- <tr>- <td colspan="4" style="padding:8px 0; font-size:13px; color:#8a86a3; border-top:1px solid #e7e4f4;">- + {{ ledger_overflow }} quieter {{ 'agent' if ledger_overflow == 1 else 'agents' }} ran {{ '{:,}'.format(rest_runs) }} {{ 'time' if rest_runs == 1 else 'times' }}{{ ', clean' if rest_issues == 0 else ', ' ~ rest_issues ~ ' with issues' }} —- <a href="{{ urls.dashboard }}" style="color:#6d28d9; font-weight:700; text-decoration:underline;">see the full ledger</a>- </td>- </tr>- {%- endif %}- <tr>- <td colspan="2" class="sum" style="padding:9px 0 2px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:11px; letter-spacing:0.5px; font-weight:bold; color:#5d5872; border-top:1px solid #d9d5ec;">- {{ '{:,.2f}'.format(totals.credits_used) }} CREDITS USED{% if totals.usd_estimate is not none %} (${{ '{:,.2f}'.format(totals.usd_estimate) }}){% endif %}- </td>- <td colspan="2" align="right" class="sum" style="padding:9px 0 2px 12px; white-space:nowrap; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:11px; letter-spacing:0.5px; font-weight:bold; color:#5d5872; border-top:1px solid #d9d5ec;">- BALANCE {{ '{:,.2f}'.format(totals.credits_balance) }}- </td>- </tr>- </table>- </td></tr>- </table>- </td></tr>-- {#- when attention cards already carry the real actions, this button would- compete with them; the ledger's own link is enough of a way through -#}- {%- if attn_count == 0 %}- <tr><td class="gutter" style="padding:24px 48px 0;">- {{ ui.btn('Open your dashboard', urls.dashboard) }}- </td></tr>- {%- endif %}- {%- else %}- <tr><td class="gutter" style="padding:18px 48px 0;">- <table role="presentation" cellpadding="0" cellspacing="0" border="0" bgcolor="#edf4ee" style="border-radius:8px;">- <tr><td style="padding:10px 16px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; letter-spacing:0.5px; font-weight:bold; color:#3f6549;">- {{ runs_fmt }} {{ run_word | upper }} · {{ totals.agents_active }} ACTIVE{% if totals.agents_idle %} · {{ totals.agents_idle }} ON STANDBY{% endif %} · {{ failed }} ISSUES · {{ '{:,.2f}'.format(totals.credits_used) }} CREDITS- </td></tr>- </table>- </td></tr>- {%- if attn_count == 0 %}- <tr><td class="gutter" style="padding:18px 48px 0;">- <div style="font-size:14px; font-weight:700;">- <a href="{{ urls.dashboard }}" style="color:#6d28d9; text-decoration:underline;">Open your dashboard</a>- </div>- </td></tr>- {%- endif %}- {%- endif %}-- <tr><td align="center" class="gutter" style="padding:26px 48px 30px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr><td height="1" bgcolor="#eeecf5" style="font-size:0; line-height:0;"> </td></tr>- <tr><td align="center" style="padding-top:14px; font-size:12px; line-height:19px; color:#8a86a3;">- You get this briefing <strong style="color:#5d5872;">{{ period.frequency }}</strong>, and only when your agents actually ran.<br>- {%- for f in ['daily', 'weekly', 'monthly'] if f != period.frequency %}- <a href="{{ urls.volume.get(f) or (urls.settings ~ '?f=' ~ f) }}" style="color:#6d28d9; text-decoration:underline;">Switch to {{ f }}</a> · - {%- endfor %}- <a href="{{ urls.volume.get('alerts') or (urls.settings ~ '?f=alerts') }}" style="color:#6d28d9; text-decoration:underline;">Alerts only</a> · - <a href="{{ urls.volume.get('off') or (urls.settings ~ '?f=off') }}" style="color:#6d28d9; text-decoration:underline;">Pause</a>- </td></tr>- </table>- </td></tr>-- </table>- </td></tr>+{{ ui.masthead() }}+{{ ui.hero_otto() }}+{{ ui.sheet_open() }}+{% call ui.eyebrow(tone='needs_you' if attn else ('confirmed' if failed == 0 else 'neutral')) %}THE BRIEFING · {{ period.label | upper }}{% endcall %}+{% call ui.headline() %}{{ subject }}{% endcall %}+{% call ui.para() %}Hi {{ first_name | default('there', true) }}, here is your {{ period.adjective }} in workflows. {{ preheader }}{% endcall %}+{% if quiet and only_agent %}+{% call ui.para() %}{{ only_agent }} was your only workflow at work {{ period.noun }}. {{ quiet_summary | default('Nothing needed your attention.', true) }}{% endcall %}+{% elif standout %}+{% call ui.para() %}{{ standout }}{% endcall %}+{% endif %}+{% for item in attn[:3] %}+<tr><td class="gutter" style="padding:{{ '22px' if loop.first else '12px' }} 48px 0;">{{ ui.attention_card(item, primary=loop.first) }}</td></tr>+{% endfor %}+{% if attn | length > 3 %}+{% call ui.para(size=14, lh=21) %}+ {{ attn | length - 3 }} more {{ 'thing needs' if attn | length == 4 else 'things need' }} you. <a href="{{ urls.attention }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">Review everything waiting</a>{% endcall %}+{% endif %}+{% if highlights %}+{% set rows = [] %}+{% for h in highlights[:3] %}{% set _ = rows.append((h.agent, h.gist, h.link_label, h.url)) %}{% endfor %}+{{ ui.also_panel('Worth a look', rows) }}+{% endif %}+{{ ui.kvpanel([('Runs', '{:,}'.format(totals.runs), true), ('Active workflows', totals.agents_active, true), ('Workflows on standby', totals.agents_idle | default(0), true), ('Failed runs', failed, true), ('Credits used', '{:,.2f}'.format(totals.credits_used) ~ (' ($' ~ '{:,.2f}'.format(totals.usd_estimate) ~ ')' if totals.usd_estimate is not none else ''), true), ('Credit balance', '{:,.2f}'.format(totals.credits_balance), true)]) }}+{% if not quiet %}+{% call ui.note_card('The ledger') %}+{% for row in ledger %}+<div style="{{ 'padding-top:12px; margin-top:12px; border-top:1px solid #E7E4F4;' if not loop.first }}">+<strong style="color:#171925;">{{ row.agent }}</strong><br>+<span style="font-family:{{ ui.MONO }}; font-size:13px;">{{ '{:,}'.format(row.runs) }} {{ 'run' if row.runs == 1 else 'runs' }} · {{ '%.2f' | format(row.credits) }} credits</span><br>+<span style="font-size:14px; color:{{ '#B45309' if row.issues_label else '#575072' }};">{{ row.issues_label or 'No issues' }}</span>+</div>+{% endfor %}+{% if ledger_overflow %}+<div style="padding-top:12px; font-size:14px;">+ {{ ledger_overflow }} quieter {{ 'workflow' if ledger_overflow == 1 else 'workflows' }} ran {{ '{:,}'.format(ledger_overflow_runs) }} {{ 'time' if ledger_overflow_runs == 1 else 'times' }}{{ ', with no issues' if ledger_overflow_issues == 0 else ', ' ~ ledger_overflow_issues ~ ' with issues' }}.</div>+{% endif %}+{% endcall %}+{% endif %}+{% call ui.para(size=14, lh=21) %}<a href="{{ urls.dashboard }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">Review run history</a>{% endcall %}+{{ ui.volume_knob(urls.volume, current=period.frequency) }}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{%- if quiet %}-{{ ui.legal_footer('This is your agent briefing for ' ~ user_email ~ ' — if truly nothing runs, we simply don’t send one.', urls.unsubscribe) }}-{%- else %}-{{ ui.legal_footer('This is your agent briefing for ' ~ user_email ~ ' — sent because your agents ran ' ~ period.noun ~ '. They insisted.', urls.unsubscribe) }}-{%- endif %}--</td></tr>-</table>-</body>-</html>+{{ ui.product_footer('This is your Briefing for ' ~ user_email ~ '.', urls.unsubscribe) }}+</td></tr></table>+</body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/briefing.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/briefing.subject.j2index 1ffe02a6dc..f136c2bfb9 100644--- a/autogpt_platform/backend/backend/notifications/templates/briefing.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/briefing.subject.j2@@ -1,28 +1,15 @@-{#- Renders two lines: line 1 = subject, line 2 = preheader.- subject_note is an optional short server-built phrase, e.g.- "Lead Scout found 41 leads" (from the top highlight). -#}{%- set runs = totals.runs -%}{%- set failed = totals.failed | default(0) -%}-{%- set attn = attention | default([]) -%}-{%- set attn_count = attn | length -%}+{%- set attn_count = attention | default([]) | length -%}{%- set runs_fmt = '{:,}'.format(runs) -%}{%- set run_word = 'run' if runs == 1 else 'runs' -%}-{%- set active = totals.agents_active -%}-{%- set quiet = (mode | default('standard')) == 'quiet' -%}-{%- set bad_period = (not quiet) and runs > 0 and failed >= 3 and failed * 3 >= runs -%}-{%- if quiet -%}-Quiet {{ period.adjective }}: {{ subject_note | default(runs_fmt ~ ' ' ~ run_word ~ ', nothing needed you') }}-{% if highlights %}{{ highlights[0].agent }} {{ highlights[0].gist }}{% else %}Everything ran on schedule; no issues and nothing waiting on you.{% endif %}-{%- elif bad_period -%}-{{ failed }} of {{ runs_fmt }} runs failed {{ period.noun }}{% if attn_count > 0 %} — {{ attn_count }} {{ 'thing needs' if attn_count == 1 else 'things need' }} you{% endif %}-{% if attn %}{{ attn[0].title }}{% if attn_count == 2 %} and 1 more is waiting on you{% elif attn_count > 2 %} and {{ attn_count - 1 }} more are waiting on you{% endif %}.{% else %}See what went wrong and where.{% endif %}-{%- elif attn_count > 0 -%}+{%- if attn_count -%}{{ runs_fmt }} {{ run_word }}, {{ '1 thing needs' if attn_count == 1 else attn_count ~ ' things need' }} you{% if subject_note %} · {{ subject_note }}{% endif %}-{{ attn[0].title }}{% if attn_count > 1 %} and {{ attn_count - 1 }} more{% endif %}{% if failed == 0 %} — the rest ran clean.{% else %} — plus {{ failed }} failed {{ 'run' if failed == 1 else 'runs' }}.{% endif %}-{%- elif failed > 0 -%}-{{ runs_fmt }} {{ run_word }}, {{ failed }} failed — nothing blocked on you{% if subject_note %} · {{ subject_note }}{% endif %}-{% if highlights %}{{ highlights[0].agent }} {{ highlights[0].gist }}{% else %}The failures didn’t block anything; details inside.{% endif %}+{{ failed }} {{ 'run failed' if failed == 1 else 'runs failed' }} and {{ attn_count }} {{ 'item needs' if attn_count == 1 else 'items need' }} your attention.+{%- elif failed -%}+{{ runs_fmt }} {{ run_word }}, {{ failed }} failed{% if subject_note %} · {{ subject_note }}{% endif %}+Review the failed runs to see what happened and what to do next.{%- else -%}-All clear: {{ runs_fmt }} {{ run_word }}{% if active > 1 %} across {{ active }} agents{% endif %}{% if subject_note %} · {{ subject_note }}{% endif %}-{% if highlights %}{{ highlights[0].agent }} {{ highlights[0].gist }}{% else %}Every run finished clean; nothing is waiting on you.{% endif %}+All clear: {{ runs_fmt }} {{ run_word }}{% if subject_note %} · {{ subject_note }}{% endif %}+Every run finished cleanly and nothing is waiting on you.{%- endif -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/briefing.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/briefing.txt.j2index 70dbe3f702..ea5050c287 100644--- a/autogpt_platform/backend/backend/notifications/templates/briefing.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/briefing.txt.j2@@ -5,9 +5,14 @@{%- set attn = attention | default([]) -%}{{ subject }}-{{ preheader }}+Hi {{ first_name | default('there', true) }}, here is your {{ period.adjective }} in workflows. {{ preheader }}+{% if quiet and only_agent %}+{{ only_agent }} was your only workflow at work {{ period.noun }}. {{ quiet_summary | default('Nothing needed your attention.', true) }}+{% elif standout %}+{{ standout }}+{% endif %}-YOUR {{ {'daily':'DAY','weekly':'WEEK','monthly':'MONTH'}.get(period.frequency, 'WEEK') }} IN AGENTS - {{ period.label }}+YOUR {{ {'daily':'DAY','weekly':'WEEK','monthly':'MONTH'}.get(period.frequency, 'WEEK') }} IN WORKFLOWS - {{ period.label }}{% if attn %}NEEDS YOU{% for item in attn[:3] %}@@ -34,21 +39,27 @@ THE LEDGER{% endfor %}{% if ledger_overflow %}-- + {{ ledger_overflow }} quieter agents: {{ urls.dashboard }}+- + {{ ledger_overflow }} quieter workflows ran {{ '{:,}'.format(ledger_overflow_runs) }} times, {{ ledger_overflow_issues }} with issues: {{ urls.dashboard }}{% endif %}+{{ '{:,}'.format(totals.runs) }} runs, {{ totals.agents_active }} active workflows, {{ totals.agents_idle | default(0) }} on standby, {{ totals.failed }} failed runs.{{ '{:,.2f}'.format(totals.credits_used) }} credits used{% if totals.usd_estimate is not none %} (${{ '{:,.2f}'.format(totals.usd_estimate) }}){% endif %} - balance {{ '{:,.2f}'.format(totals.credits_balance) }}{% else %}-{{ '{:,}'.format(totals.runs) }} runs - {{ totals.agents_active }} active{% if totals.agents_idle %} - {{ totals.agents_idle }} on standby{% endif %} - {{ totals.failed }} issues - {{ '{:,.2f}'.format(totals.credits_used) }} credits+{{ '{:,}'.format(totals.runs) }} runs - {{ totals.agents_active }} active{% if totals.agents_idle %} - {{ totals.agents_idle }} on standby{% endif %} - {{ totals.failed }} issues - {{ '{:,.2f}'.format(totals.credits_used) }} credits{% if totals.usd_estimate is not none %} (${{ '{:,.2f}'.format(totals.usd_estimate) }}){% endif %} - balance {{ '{:,.2f}'.format(totals.credits_balance) }}{% endif %}-Open your dashboard: {{ urls.dashboard }}+Review run history: {{ urls.dashboard }}---You get this briefing {{ period.frequency }}, and only when your agents-actually ran. Switch to daily, weekly or monthly, choose alerts only, or-pause it entirely: {{ urls.settings }}+You get this briefing {{ period.frequency }}, and only when your workflows+actually ran. Current frequency: {{ period.frequency }}.+{% for key, label in [('daily', 'Daily'), ('weekly', 'Weekly'), ('monthly', 'Monthly'), ('alerts', 'Alerts only'), ('off', 'Pause')] %}+{{ label }}: {{ urls.volume.get(key) or (urls.settings ~ '?f=' ~ key) }}+{% endfor %}+Notification settings: {{ urls.settings }}-This is your agent briefing for {{ user_email }}.+This is your Briefing for {{ user_email }}.+AutoGPT: https://agpt.coAutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKUnsubscribe: {{ urls.unsubscribe }}+Discord: {{ urls.discord }}diff --git a/autogpt_platform/backend/backend/notifications/templates/changelog.html.j2 b/autogpt_platform/backend/backend/notifications/templates/changelog.html.j2index eba01f52aa..83f8d972fc 100644--- a/autogpt_platform/backend/backend/notifications/templates/changelog.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/changelog.html.j2@@ -1,45 +1,45 @@{#- ============================================================- changelog.html.j2 — the monthly "AutoGPT Update".+ changelog.html.j2: the monthly "AutoGPT Update".Content is authored in MailerLite; this template is the shareddesign reference for that campaign. Context:edition_label "July 2026"- period_label "June 18 – July 9"+ period_label "June 18 · July 9"intro one casual sentenceentries [ { emoji, title, body, url } ... ]urls shared link mapSent monthly to the changelog MailerLite group · marketingfooter · signed by John.============================================================ -#}-{%- import "_lifecycle_ui.j2" as ui with context -%}+{%- import "_email_ui.j2" as ui with context -%}<!doctype html><html lang="en"><head>{{ ui.head_block(subject) }}</head>-<body style="margin:0; padding:0; background-color:#eceaf6; -webkit-text-size-adjust:100%; font-family:'Poppins',Helvetica,Arial,sans-serif;">+{{ ui.body_open() }}{{ ui.preheader(preheader) }}{{ ui.page_open() }}{{ ui.masthead() }}{{ ui.hero('changelog') }}<tr><td bgcolor="#ffffff" style="border-radius:0 0 16px 16px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-{% call ui.eyebrow(color='#5635b2') %}AUTOGPT UPDATE · {{ edition_label | upper }}{% endcall %}-{% call ui.headline() %}What's new — {{ period_label }}{% endcall %}-{% call ui.para() %}Hey {{ user_name }} — {{ intro }}{% endcall %}+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">+{% call ui.eyebrow(tone='brand') %}AUTOGPT UPDATE · {{ edition_label | upper }}{% endcall %}+{% call ui.headline() %}What's new: {{ period_label }}{% endcall %}+{% call ui.para() %}Hey {{ user_name }}, {{ intro }}{% endcall %}<tr><td class="gutter" style="padding:20px 48px 0;">{%- for e in entries %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f5f3fb" style="border-radius:10px;{{ ' margin-top:10px;' if not loop.first }}"><tr><td style="padding:14px 16px;">- <div style="font-size:14px; font-weight:700; color:#070629;">{{ e.emoji }} {{ e.title }}</div>+ <div style="font-size:14px; font-weight:700; color:#171925;">{{ e.emoji }} {{ e.title }}</div><div style="font-size:13.5px; line-height:21px; color:#2d2a3e; padding-top:3px;">{{ e.body }}</div>- <div style="font-size:13px; padding-top:5px;"><a href="{{ e.url }}" style="color:#5635b2; font-weight:700; text-decoration:underline;">Learn more</a></div>+ <div style="font-size:13px; padding-top:5px;"><a href="{{ e.url }}" style="color:#6144DF; font-weight:700; text-decoration:underline;">Learn more</a></div></td></tr></table>{%- endfor %}</td></tr>-{{ ui.cta('See the full changelog', urls.changelog, 'Everything we ship lands there weekly — this email is just the monthly roundup.') }}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Something here you asked for? That's not a coincidence — reply and tell me what should be in next month's edition.{% endcall %}-{{ ui.signature('John Ababseh', 'Product Manager · AutoGPT', '[email protected]') }}+{{ ui.cta('See the full changelog', urls.changelog, 'Everything we ship lands there weekly. This email is just the monthly roundup.') }}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Something here you asked for? That's not a coincidence. Reply and tell me what should be in next month's edition.{% endcall %}+{{ ui.signature('John Ababseh', 'Head of Product · AutoGPT', '[email protected]') }}{{ ui.close_row('The monthly update lands the same week each month.', 'Choose which emails you get', urls.prefs) }}</table></td></tr>diff --git a/autogpt_platform/backend/backend/notifications/templates/changelog.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/changelog.subject.j2index 2a80ada6ae..2f7c088538 100644--- a/autogpt_platform/backend/backend/notifications/templates/changelog.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/changelog.subject.j2@@ -1,2 +1,2 @@-AutoGPT Update — {{ edition_label }}+AutoGPT Update: {{ edition_label }}{{ subject_teaser }}diff --git a/autogpt_platform/backend/backend/notifications/templates/lifecycle.html.j2 b/autogpt_platform/backend/backend/notifications/templates/lifecycle.html.j2index f311d1df9e..07d9675c3e 100644--- a/autogpt_platform/backend/backend/notifications/templates/lifecycle.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/lifecycle.html.j2@@ -1,145 +1,81 @@-{#- ============================================================- lifecycle.html.j2 — billing & account emails, one template.- kind: welcome | drip1 | payment_failed | final_notice |- cancel_confirmed | cancel_reversed | ended | trial_ending- Plan-bearing kinds receive `plan`:- { name, label ("Pro — monthly"), price_display ("$50.00 / month"),- cycle ("monthly"|"yearly"), cycle_noun ("month"|"year") }- Every sentence is assembled from context slots — no per-scenario- copy edits. See make_lifecycle_scenarios.py for the context schema.- ============================================================ -#}-{%- import "_lifecycle_ui.j2" as ui with context -%}+{%- import "_email_ui.j2" as ui with context -%}<!doctype html><html lang="en">-<head>-{{ ui.head_block(subject) }}-</head>-<body style="margin:0; padding:0; background-color:#f1efe9; -webkit-text-size-adjust:100%; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">+<head>{{ ui.head_block(subject) }}</head>+{{ ui.body_open() }}{{ ui.preheader(preheader) }}{{ ui.page_open() }}{{ ui.masthead() }}-{%- if kind == 'welcome' %}-{{ ui.hero('welcome') }}-{%- elif kind == 'payment_failed' %}-{{ ui.hero('payment_hiccup') }}-{%- elif kind == 'final_notice' %}-{{ ui.hero('final_notice') }}-{%- elif kind == 'cancel_confirmed' %}-{{ ui.hero('cancel_safe') }}-{%- elif kind == 'cancel_reversed' %}-{{ ui.hero('welcome_back') }}-{%- elif kind == 'ended' %}-{{ ui.hero('plan_asleep') }}-{%- else %}-{{ ui.hero('trial_headsup') }}-{%- endif %}- <tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-{%- if kind == 'welcome' %}-{% call ui.eyebrow(color='#1c7a52') %}PLAN ACTIVE · {{ plan.label | upper }}{% endcall %}-{% call ui.headline() %}You're in. Let's put an agent to work.{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — your {{ plan.name }} subscription is active and everything on your plan is unlocked. Here's your setup at a glance:{% endcall %}+{{ ui.hero_otto() }}+{{ ui.sheet_open() }}+{% if kind == 'welcome' %}+{% call ui.eyebrow(tone='confirmed') %}PLAN ACTIVE · {{ plan.label | upper }}{% endcall %}+{% call ui.headline() %}You're in. Let's put {{ 'Otto' if experts_enabled | default(false) else 'a workflow' }} to work.{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, your {{ plan.name }} subscription is active. {{ preheader }}{% endcall %}{{ ui.kvpanel([('Plan', plan.label, false), ('Price', plan.price_display, true), ('Renews', renews_label, true)]) }}-{% call ui.para() %}The best first step takes about ten minutes: pick a ready-made agent from the Marketplace, connect it to something you actually use, and watch it run.{% endcall %}-{{ ui.cta('Build your first agent', urls.marketplace, 'Takes about ten minutes with a Marketplace agent — no building on day one.') }}+{% if experts_enabled | default(false) %}+{% call ui.para() %}Start with a real task: hire an AI Expert from the Marketplace, share what you need, and review the result with Otto, your personal Head of AI.{% endcall %}+{{ ui.cta('Hire your first Expert', urls.marketplace) }}+{% else %}+{% call ui.para() %}Start with a real task: install a workflow from the Marketplace, connect the accounts it needs, and review its first run.{% endcall %}+{{ ui.cta('Install your first workflow', urls.marketplace) }}+{% endif %}{{ ui.also_panel('Three good places to start', [- ('The quick-start guide', '— from zero to a running agent, step by step.', 'Open the guide', urls.docs),- ('The Marketplace', '— proven agents you can use as-is or remix.', 'Browse agents', urls.marketplace),- ('Discord', "— where builders share what's working.", 'Join in', urls.discord),+ ('The quick-start guide.', 'Set up your first task, step by step.', 'Open the guide', urls.docs),+ ('The Marketplace.', 'Find an AI Expert for the work you need done.' if experts_enabled | default(false) else 'Find a workflow for the work you need done.', 'Browse Experts' if experts_enabled | default(false) else 'Browse workflows', urls.marketplace),+ ('Discord.', 'See what other people are building.', 'Join in', urls.discord),]) }}-{{ ui.signature('Toran Bruce Richards', 'Founder · AutoGPT') }}-{{ ui.close_row('You can change or cancel your plan any time.', 'Billing settings', urls.billing) }}-{%- elif kind == 'drip1' %}-{% call ui.eyebrow(color='#5635b2') %}GETTING STARTED · {{ series.n }} OF {{ series.of }}{% endcall %}-{% call ui.headline() %}Ten minutes to your first working agent{% endcall %}-{% call ui.para() %}Yesterday you joined AutoGPT. Today, let's make it earn its keep. The fastest way to understand agents isn't reading about them — it's watching one do a job you'd rather not do yourself.{% endcall %}-{{ ui.steps([- ('Pick a job, not a demo.', 'Something small and real: summarise your unread newsletters, watch a webpage for changes, draft replies to a form inbox.'),- ('Grab a Marketplace agent.', 'Search for that job — most agents work out of the box, no building required on day one.'),- ('Connect one thing.', 'A single account (say, Gmail or a webhook) is enough to see the whole loop run.'),- ('Press run, then schedule it.', "Run it once manually. Happy with the result? Set a schedule and it's off your plate for good."),-]) }}-{{ ui.cta('Open the Marketplace', urls.marketplace, "Tomorrow: how to read what your agent did while you weren't looking.") }}-{{ ui.close_row('You are getting the getting-started series because you joined AutoGPT this week.', 'Choose which emails you get', urls.prefs) }}-{%- elif kind == 'payment_failed' %}+{{ ui.signature('Toran Bruce Richards', 'Founder · AutoGPT', '[email protected]') }}+{{ ui.close_row('You received this because your subscription is active.', 'Billing settings', urls.billing) }}+{% elif kind == 'payment_failed' %}{{ ui.strip_amber('NEEDS YOU · PAYMENT DECLINED') }}-{% call ui.headline(top=26) %}Your payment didn't go through{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — we tried to charge your card for this {{ plan.cycle_noun }}'s renewal on your {{ plan.name }} plan, and the payment was declined. This happens: cards expire, banks get cautious, limits get hit. Your plan and your agents keep running normally while we retry.{% endcall %}+{% call ui.eyebrow(tone='needs_you') %}YOUR {{ plan.name | upper }} PLAN{% endcall %}+{% call ui.headline() %}Your payment didn't go through{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, the renewal payment for your {{ plan.name }} plan was declined. {{ preheader }}{% endcall %}{{ ui.kvpanel([('Amount', amount_display, true), ('Card', card.brand ~ ' ···· ' ~ card.last4, true), ('Next retry', next_retry_label ~ ' · automatic', true)]) }}-{% call ui.para() %}If the card details are out of date, fixing it takes about a minute:{% endcall %}-{{ ui.cta('Update payment method', urls.billing, "Already updated your card? You're set — we'll charge the new one on the next retry.") }}-{{ ui.close_row('You will only hear about this again if the automatic retries fail.', 'Billing settings', urls.billing) }}-{%- elif kind == 'final_notice' %}-{{ ui.strip_amber('FINAL NOTICE · PLAN PAUSES ' ~ (pauses_label | upper)) }}-{% call ui.headline(top=26) %}Last try — let's keep your agents running{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — we've attempted this {{ plan.cycle_noun }}'s payment for your {{ plan.name }} plan several times over the past two weeks, and each attempt was declined. This is the final notice before your plan pauses.{% endcall %}-{{ ui.kvpanel([('Amount due', amount_display, true), ('Plan pauses on', pauses_label, true), ('What pauses', 'Scheduled runs & ' ~ plan.name ~ ' features', false)]) }}-{% call ui.note_card('If the plan pauses', tone='amber') %}Scheduled agents stop running until a payment succeeds — then everything picks up exactly where it left off. Your agents and their data are kept safe; nothing is deleted.{% endcall %}-{{ ui.cta('Update payment method', urls.billing, 'Card working fine on your side? Banks sometimes block recurring charges — a quick call to yours usually clears it.') }}-{{ ui.close_row('Stuck? Reply to this email — a human reads it.', 'Billing settings', urls.billing) }}-{%- elif kind == 'cancel_confirmed' %}+{% call ui.para() %}Your plan and scheduled workflows keep running while we retry. If your card details have changed, update them before the next attempt.{% endcall %}+{{ ui.cta('Update payment method', urls.billing, "Already updated your card? We'll use the new one on the next retry.") }}+{{ ui.close_row('You received this because your renewal payment was declined.', 'Billing settings', urls.billing) }}+{% elif kind == 'final_notice' %}+{{ ui.strip_amber('NEEDS YOU · FINAL PAYMENT NOTICE') }}+{% call ui.eyebrow(tone='needs_you') %}PLAN PAUSES {{ pauses_label | upper }}{% endcall %}+{% call ui.headline() %}Keep your scheduled work running{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, we couldn't collect payment for your {{ plan.name }} plan after several attempts. {{ preheader }}{% endcall %}+{{ ui.kvpanel([('Amount due', amount_display, true), ('Plan pauses on', pauses_label, true), ('What pauses', 'Scheduled runs and ' ~ plan.name ~ ' features', false)]) }}+{% call ui.note_card('If the plan pauses', tone='amber') %}Scheduled workflows stop running until payment succeeds. Your workflows and their data stay saved in your account.{% endcall %}+{{ ui.cta('Update payment method', urls.billing) }}+{{ ui.close_row('You received this because the payment retries failed.', 'Billing settings', urls.billing) }}+{% elif kind == 'cancel_confirmed' %}{% call ui.eyebrow() %}YOUR PLAN · ENDS {{ access_until_label | upper }}{% endcall %}{% call ui.headline() %}Cancellation confirmed{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — we've cancelled the renewal on your {{ plan.name }} plan, as requested. No further charges will be made, and you keep full {{ plan.name }} access for the time you've already paid for.{% endcall %}-{{ ui.kvpanel([('Plan', plan.label, false), ('Access until', access_until_label, true), ('After that', 'Agents pause — work kept safe', false)]) }}-{% call ui.para() %}When the plan ends, your agents and everything you've built stay saved in your account — they just stop running on schedule. Come back any time and switch them on again.{% endcall %}-{{ ui.cta('Resume my plan', urls.billing, 'Only if you change your mind before ' ~ access_until_label ~ " — otherwise there's nothing more to do.") }}-{% call ui.para(color='#575072', size=13, lh=20, top=20) %}Thanks for building with us. If something didn't work the way you needed, reply and tell us — it comes straight to me, and I read every one.{% endcall %}-{{ ui.signature('John Ababseh', 'Product Manager · AutoGPT', '[email protected]', top=18) }}-{{ ui.close_row('This confirmation was sent the moment you cancelled.', 'Billing settings', urls.billing) }}-{%- elif kind == 'cancel_reversed' %}-{% call ui.eyebrow(color='#1c7a52') %}YOUR PLAN · RESUMED{% endcall %}-{% call ui.headline() %}Welcome back — your plan continues{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — you've resumed your {{ plan.name }} plan, so the cancellation is off. Nothing pauses, nothing changes: your agents keep running exactly as before.{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, we've cancelled the renewal on your {{ plan.name }} plan, as requested. {{ preheader }}{% endcall %}+{{ ui.kvpanel([('Plan', plan.label, false), ('Access until', access_until_label, true), ('After that', 'Scheduled workflows pause; work stays saved', false)]) }}+{% call ui.para() %}Your workflows and data stay in your account when the plan ends. You can resume your plan in billing settings if you change your mind.{% endcall %}+{{ ui.close_row('This confirmation was sent because you cancelled your renewal.', 'Billing settings', urls.billing) }}+{% elif kind == 'cancel_reversed' %}+{% call ui.eyebrow(tone='confirmed') %}YOUR PLAN · RESUMED{% endcall %}+{% call ui.headline() %}Your plan continues{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, you've resumed your {{ plan.name }} plan, so the cancellation is off. {{ preheader }}{% endcall %}{{ ui.kvpanel([('Plan', plan.label, false), ('Next renewal', renews_label, true), ('Price', plan.price_display, true)]) }}-{% call ui.note_card('About that earlier email') %}The message saying your plan would end no longer applies — you can safely ignore it.{% endcall %}-{{ ui.cta('Back to my agents', urls.dashboard) }}-{{ ui.close_row('Glad to have you along.', 'Billing settings', urls.billing) }}-{%- elif kind == 'ended' %}+{% call ui.note_card('About that earlier email') %}The message saying your plan would end no longer applies. Your scheduled workflows keep running.{% endcall %}+{{ ui.cta('Open AutoGPT', urls.dashboard) }}+{{ ui.close_row('You received this because you resumed your plan.', 'Billing settings', urls.billing) }}+{% elif kind == 'ended' %}{% call ui.eyebrow() %}YOUR PLAN · ENDED {{ ended_label | upper }}{% endcall %}{% call ui.headline() %}Your plan has ended{% endcall %}-{%- if due_to_payment %}-{% call ui.para() %}Hi {{ user_name }} — we couldn't collect payment for your {{ plan.name }} plan after several attempts, so it ended today and paid features are now switched off. Here's exactly where things stand:{% endcall %}-{{ ui.kvpanel([('Ended on', ended_label, true), ('Why', 'Payment could not be collected', false), ('Your agents', 'Paused — saved as you left them', false), ('Your data', 'Kept safe in your account', false)]) }}-{%- else %}-{% call ui.para() %}Hi {{ user_name }} — your {{ plan.name }} plan reached the end of its billing period today, as scheduled after your cancellation, so paid features are now switched off. Here's exactly where things stand:{% endcall %}-{{ ui.kvpanel([('Ended on', ended_label, true), ('Your agents', 'Paused — saved as you left them', false), ('Your data', 'Kept safe in your account', false)]) }}-{%- endif %}-{% call ui.para() %}Everything you built is one click from running again. Restart whenever you're ready and your agents pick up where they left off — schedules, connections and all.{% endcall %}-{%- if due_to_payment %}-{{ ui.cta('Restart my plan', urls.billing, 'Restarting takes a working card — you can update it in the same place.') }}-{%- else %}-{{ ui.cta('Restart my plan', urls.billing, 'Your account stays free to use in the meantime.') }}-{%- endif %}-{% call ui.para(color='#575072', size=13, lh=20, top=20) %}Not the right time? I'd genuinely love to hear what would have made {{ plan.name }} worth keeping — just reply, it comes straight to me.{% endcall %}-{{ ui.signature('John Ababseh', 'Product Manager · AutoGPT', '[email protected]', top=18) }}-{{ ui.close_row("We don't delete your work when a plan ends.", 'Billing settings', urls.billing) }}-{%- elif kind == 'trial_ending' %}-{% call ui.eyebrow(color='#5635b2') %}YOUR TRIAL · {{ days_left }} DAYS LEFT{% endcall %}-{% call ui.headline() %}{{ days_left_word }} days left on your trial{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — your AutoGPT {{ plan.name }} trial ends on <strong style="color:#070629;">{{ ends_label }}</strong>. No surprises; here's exactly what happens next:{% endcall %}-{%- if has_payment_method %}-{{ ui.kvpanel([('Trial ends', ends_label, true), ('Then', plan.name ~ ' continues at ' ~ plan.price_display, true), ('First charge', first_charge_label ~ ' · ' ~ card.brand ~ ' ···· ' ~ card.last4, true)]) }}-{% call ui.para() %}If AutoGPT has been pulling its weight, you don't need to do a thing — your plan continues automatically and your agents never miss a run. Want a moment to decide? You can cancel in two clicks, keep everything you've built, and come back later.{% endcall %}-{{ ui.cta('Review my plan', urls.billing, 'Cancel before ' ~ ends_label ~ " and you won't be charged anything.") }}-{%- else %}-{{ ui.kvpanel([('Trial ends', ends_label, true), ('To continue', plan.name ~ ' at ' ~ plan.price_display, true), ('Payment method', 'None on file yet', false)]) }}-{% call ui.para() %}There's no card on file, so nothing will ever be charged automatically. If you want {{ plan.name }} to continue after the trial, add a payment method before {{ ends_label }} — otherwise your trial simply ends, and everything you've built stays saved on the free tier.{% endcall %}-{{ ui.cta('Add a payment method', urls.billing, 'Takes about a minute — and nothing is charged until the trial actually ends.') }}-{%- endif %}-{{ ui.close_row('One email, ' ~ days_left ~ ' days ahead — that is the whole reminder.', 'Billing settings', urls.billing) }}-{%- endif %}- </table>- </td></tr>+{% if due_to_payment %}+{% call ui.para() %}Hi {{ user_name }}, your {{ plan.name }} plan ended on {{ ended_label }} because we couldn't collect payment. {{ preheader }}{% endcall %}+{{ ui.kvpanel([('Ended on', ended_label, true), ('Why', 'Payment could not be collected', false), ('Scheduled workflows', 'Paused; work stays saved', false), ('Your data', 'Kept in your account', false)]) }}+{% else %}+{% call ui.para() %}Hi {{ user_name }}, your {{ plan.name }} plan ended on {{ ended_label }}, as scheduled after your cancellation. {{ preheader }}{% endcall %}+{{ ui.kvpanel([('Ended on', ended_label, true), ('Scheduled workflows', 'Paused; work stays saved', false), ('Your data', 'Kept in your account', false)]) }}+{% endif %}+{% call ui.para() %}You can restart your plan in billing settings whenever you're ready.{% endcall %}+{{ ui.cta('Restart my plan', urls.billing) }}+{{ ui.close_row('You received this because your paid plan ended.', 'Billing settings', urls.billing) }}+{% endif %}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{%- if kind == 'drip1' %}-{{ ui.legal_footer('This is part ' ~ series.n ~ ' of ' ~ series.of ~ ' of the getting-started series, for ' ~ user_email ~ '.', 'Unsubscribe', urls.unsubscribe, discord=true) }}-{%- elif kind == 'welcome' %}-{{ ui.legal_footer("This is a service message about the AutoGPT account for " ~ user_email ~ " — it's sent even if you've opted out of product news.", 'Email preferences', urls.prefs, discord=true) }}-{%- else %}-{{ ui.legal_footer("This is a service message about the AutoGPT account for " ~ user_email ~ " — it's sent even if you've opted out of product news.", 'Email preferences', urls.prefs, discord=false) }}-{%- endif %}--</td></tr>-</table>+{{ ui.legal_footer("This is a service message about the AutoGPT account for " ~ user_email ~ ". It's sent even if you've opted out of product news.", 'Email preferences', urls.prefs, discord=true) }}+</td></tr></table></body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/lifecycle.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/lifecycle.subject.j2index b81b36f09c..d7049dbc84 100644--- a/autogpt_platform/backend/backend/notifications/templates/lifecycle.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/lifecycle.subject.j2@@ -1,9 +1,13 @@-{% if kind == 'welcome' %}Welcome to AutoGPT — your {{ plan.name }} plan is live-Your {{ plan.label }} plan is active. Here's the fastest route to your first working agent.{% elif kind == 'drip1' %}Build your first agent in 10 minutes-Ten minutes, one working agent. Let's build.{% elif kind == 'payment_failed' %}We couldn't process your payment-No panic — we'll retry automatically on {{ next_retry_label }}. Updating your card takes a minute.{% elif kind == 'final_notice' %}Action needed: your AutoGPT plan pauses on {{ pauses_label }}-We've tried several times without luck. One click keeps your agents running.{% elif kind == 'cancel_confirmed' %}Your cancellation is confirmed-Your plan stays active until {{ access_until_label }}. Nothing is deleted.{% elif kind == 'cancel_reversed' %}Your AutoGPT plan will continue-Good news — your {{ plan.name }} plan renews on {{ renews_label }} as usual.{% elif kind == 'ended' %}Your AutoGPT plan has ended-{% if due_to_payment %}We couldn't collect payment. Your agents are paused, not deleted — restarting takes one click.{% else %}Your agents are paused, not deleted. Pick up right where you left off.{% endif %}{% elif kind == 'trial_ending' %}Your free trial ends on {{ ends_label }}-{% if has_payment_method %}Your trial ends in {{ days_left }} days. Here's exactly what happens next.{% else %}Your trial ends in {{ days_left }} days — nothing is charged unless you add a card.{% endif %}{% endif %}+{% if kind == 'welcome' %}Welcome to AutoGPT: your {{ plan.name }} plan is live+Here's your setup at a glance.+{% elif kind == 'payment_failed' %}We couldn't process your payment+We'll retry automatically on {{ next_retry_label }}.+{% elif kind == 'final_notice' %}Action needed: your AutoGPT plan pauses on {{ pauses_label }}+Update your payment method before your plan pauses on {{ pauses_label }}.+{% elif kind == 'cancel_confirmed' %}Your cancellation is confirmed+No further renewal charges will be made, and your access continues until {{ access_until_label }}.+{% elif kind == 'cancel_reversed' %}Your AutoGPT plan will continue+Your plan renews on {{ renews_label }} as usual.+{% elif kind == 'ended' %}Your AutoGPT plan has ended+Your scheduled workflows are paused, and your work stays saved in your account.+{% endif %}diff --git a/autogpt_platform/backend/backend/notifications/templates/lifecycle.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/lifecycle.txt.j2index 7dbed1beb3..90f04741de 100644--- a/autogpt_platform/backend/backend/notifications/templates/lifecycle.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/lifecycle.txt.j2@@ -1,192 +1,99 @@-{#- Plain-text part of the billing and account messages, branching on the same- `kind` as the HTML template and assembled from the same slots. The trial- branch of lifecycle.html.j2 has no counterpart here on purpose: the- platform does not offer trials and never emits that kind. -#}{{ subject }}-{{ preheader }}-{% if kind == 'welcome' %}-PLAN ACTIVE - {{ plan.label | upper }}--You're in. Let's put an agent to work.--Hi {{ user_name }} - your {{ plan.name }} subscription is active and everything on your-plan is unlocked. Here's your setup at a glance:+Hi {{ user_name }}, your {{ plan.name }} subscription is active. {{ preheader }}-Plan: {{ plan.label }}-Price: {{ plan.price_display }}+Plan: {{ plan.label }}+Price: {{ plan.price_display }}Renews: {{ renews_label }}-The best first step takes about ten minutes: pick a ready-made agent from the-Marketplace, connect it to something you actually use, and watch it run.--Build your first agent: {{ urls.marketplace }}+{% if experts_enabled | default(false) %}+Start with a real task: hire an AI Expert from the Marketplace, share what you need,+and review the result with Otto, your personal Head of AI.+Hire your first Expert: {{ urls.marketplace }}+{% else %}+Start with a real task: install a workflow from the Marketplace, connect the accounts+it needs, and review its first run.+Install your first workflow: {{ urls.marketplace }}+{% endif %}Three good places to start-- The quick-start guide - from zero to a running agent: {{ urls.docs }}-- The Marketplace - proven agents you can use as-is: {{ urls.marketplace }}-- Discord - where builders share what's working: {{ urls.discord }}+- Quick-start guide: {{ urls.docs }}+- {{ 'Browse Experts' if experts_enabled | default(false) else 'Browse workflows' }} in the Marketplace: {{ urls.marketplace }}+- Join Discord: {{ urls.discord }}Toran Bruce Richards-Founder - AutoGPT--You can change or cancel your plan any time: {{ urls.billing }}-{% elif kind == 'drip1' %}-GETTING STARTED - {{ series.n }} OF {{ series.of }}--Ten minutes to your first working agent--Yesterday you joined AutoGPT. Today, let's make it earn its keep. The fastest-way to understand agents isn't reading about them - it's watching one do a job-you'd rather not do yourself.+Founder · AutoGPT-1. Pick a job, not a demo.- Something small and real: summarise your unread newsletters, watch a- webpage for changes, draft replies to a form inbox.--2. Grab a Marketplace agent.- Search for that job - most agents work out of the box, no building- required on day one.--3. Connect one thing.- A single account (say, Gmail or a webhook) is enough to see the whole- loop run.--4. Press run, then schedule it.- Run it once manually. Happy with the result? Set a schedule and it's off- your plate for good.--Open the Marketplace: {{ urls.marketplace }}--Tomorrow: how to read what your agent did while you weren't looking.+You received this because your subscription is active.{% elif kind == 'payment_failed' %}-NEEDS YOU - PAYMENT DECLINED+Hi {{ user_name }}, the renewal payment for your {{ plan.name }} plan was declined. {{ preheader }}-Your payment didn't go through.--Hi {{ user_name }} - we tried to charge your card for this {{ plan.cycle_noun }}'s renewal on your-{{ plan.name }} plan, and the payment was declined. This happens: cards expire, banks-get cautious, limits get hit. Your plan and your agents keep running normally-while we retry.--Amount: {{ amount_display }}-Card: {{ card.brand }} .... {{ card.last4 }}-Next retry: {{ next_retry_label }} - automatic--If the card details are out of date, fixing it takes about a minute.+Amount: {{ amount_display }}+Card: {{ card.brand }} ···· {{ card.last4 }}+Next retry: {{ next_retry_label }} · automatic+Your plan and scheduled workflows keep running while we retry. If your card details+have changed, update them before the next attempt.Update payment method: {{ urls.billing }}+Already updated your card? We'll use the new one on the next retry.-You will only hear about this again if the automatic retries fail.+You received this because your renewal payment was declined.{% elif kind == 'final_notice' %}-FINAL NOTICE - PLAN PAUSES {{ pauses_label | upper }}--Last try - let's keep your agents running.+Hi {{ user_name }}, we couldn't collect payment for your {{ plan.name }} plan after several attempts. {{ preheader }}-Hi {{ user_name }} - we've attempted this {{ plan.cycle_noun }}'s payment for your {{ plan.name }} plan-several times over the past two weeks, and each attempt was declined. This is-the final notice before your plan pauses.--Amount due: {{ amount_display }}+Amount due: {{ amount_display }}Plan pauses on: {{ pauses_label }}-What pauses: Scheduled runs & {{ plan.name }} features--If the plan pauses, scheduled agents stop running until a payment succeeds --then everything picks up exactly where it left off. Your agents and their data-are kept safe; nothing is deleted.+What pauses: Scheduled runs and {{ plan.name }} features+Scheduled workflows stop running until payment succeeds. Your workflows and their+data stay saved in your account.Update payment method: {{ urls.billing }}-Stuck? Reply to this email - a human reads it.+You received this because the payment retries failed.{% elif kind == 'cancel_confirmed' %}-YOUR PLAN - ENDS {{ access_until_label | upper }}--Cancellation confirmed.+Hi {{ user_name }}, we've cancelled the renewal on your {{ plan.name }} plan, as requested. {{ preheader }}-Hi {{ user_name }} - we've cancelled the renewal on your {{ plan.name }} plan, as requested.-No further charges will be made, and you keep full {{ plan.name }} access for the time-you've already paid for.--Plan: {{ plan.label }}+Plan: {{ plan.label }}Access until: {{ access_until_label }}-After that: Agents pause - work kept safe--When the plan ends, your agents and everything you've built stay saved in your-account - they just stop running on schedule. Come back any time and switch-them on again.+After that: Scheduled workflows pause; work stays saved-Resume my plan: {{ urls.billing }}--Thanks for building with us. If something didn't work the way you needed,-reply and tell us - it comes straight to me, and I read every one.--John Ababseh-Product Manager - AutoGPT+Your workflows and data stay in your account when the plan ends. You can resume+your plan in billing settings if you change your mind.+This confirmation was sent because you cancelled your renewal.{% elif kind == 'cancel_reversed' %}-YOUR PLAN - RESUMED--Welcome back - your plan continues.--Hi {{ user_name }} - you've resumed your {{ plan.name }} plan, so the cancellation is off.-Nothing pauses, nothing changes: your agents keep running exactly as before.+Hi {{ user_name }}, you've resumed your {{ plan.name }} plan, so the cancellation is off. {{ preheader }}-Plan: {{ plan.label }}+Plan: {{ plan.label }}Next renewal: {{ renews_label }}-Price: {{ plan.price_display }}+Price: {{ plan.price_display }}-About that earlier email: the message saying your plan would end no longer-applies - you can safely ignore it.--Back to my agents: {{ urls.dashboard }}+The message saying your plan would end no longer applies. Your scheduled workflows+keep running.+Open AutoGPT: {{ urls.dashboard }}+You received this because you resumed your plan.{% elif kind == 'ended' %}-YOUR PLAN - ENDED {{ ended_label | upper }}--Your plan has ended.-{% if due_to_payment %}-Hi {{ user_name }} - we couldn't collect payment for your {{ plan.name }} plan after several-attempts, so it ended today and paid features are now switched off. Here's-exactly where things stand:--Ended on: {{ ended_label }}-Why: Payment could not be collected-Your agents: Paused - saved as you left them-Your data: Kept safe in your account+Hi {{ user_name }}, your {{ plan.name }} plan ended on {{ ended_label }} because we couldn't collect payment. {{ preheader }}+Why: Payment could not be collected{% else %}-Hi {{ user_name }} - your {{ plan.name }} plan reached the end of its billing period today, as-scheduled after your cancellation, so paid features are now switched off.-Here's exactly where things stand:--Ended on: {{ ended_label }}-Your agents: Paused - saved as you left them-Your data: Kept safe in your account+Hi {{ user_name }}, your {{ plan.name }} plan ended on {{ ended_label }}, as scheduled after your cancellation. {{ preheader }}{% endif %}-Everything you built is one click from running again. Restart whenever you're-ready and your agents pick up where they left off - schedules, connections and-all.+Ended on: {{ ended_label }}+Scheduled workflows: Paused; work stays saved+Your data: Kept in your account+You can restart your plan in billing settings whenever you're ready.Restart my plan: {{ urls.billing }}--Not the right time? I'd genuinely love to hear what would have made {{ plan.name }}-worth keeping - just reply, it comes straight to me.--John Ababseh-Product Manager - AutoGPT+You received this because your paid plan ended.{% endif %}+Billing settings: {{ urls.billing }}----{% if kind == 'drip1' %}-This is part {{ series.n }} of {{ series.of }} of the getting-started series,-for {{ user_email }}.-Unsubscribe: {{ urls.unsubscribe }}-{% else %}-This is a service message about the AutoGPT account for {{ user_email }} - it's-sent even if you've opted out of product news.+This is a service message about the AutoGPT account for {{ user_email }}.+It's sent even if you've opted out of product news.Email preferences: {{ urls.prefs }}-{% endif %}-+Discord: {{ urls.discord }}+AutoGPT: https://agpt.coAutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKdiff --git a/autogpt_platform/backend/backend/notifications/templates/onboarding.html.j2 b/autogpt_platform/backend/backend/notifications/templates/onboarding.html.j2index d69ae4bbc6..2e6af97977 100644--- a/autogpt_platform/backend/backend/notifications/templates/onboarding.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/onboarding.html.j2@@ -1,17 +1,17 @@{#- ============================================================- onboarding.html.j2 — the 6-email "White Glove Tour"+ onboarding.html.j2: the 6-email "White Glove Tour"(John Ababseh's MailerLite sequence, re-skinned to the unified- design system). One template; `part` (1–6) selects the email.+ design system). One template; `part` (1 to 6) selects the email.Context: user_name, user_email, part, of, day, urlsSent from MailerLite · marketing footer · signed by John.============================================================ -#}-{%- import "_lifecycle_ui.j2" as ui with context -%}+{%- import "_email_ui.j2" as ui with context -%}<!doctype html><html lang="en"><head>{{ ui.head_block(subject) }}</head>-<body style="margin:0; padding:0; background-color:#eceaf6; -webkit-text-size-adjust:100%; font-family:'Poppins',Helvetica,Arial,sans-serif;">+{{ ui.body_open() }}{{ ui.preheader(preheader) }}{{ ui.page_open() }}{{ ui.masthead() }}@@ -19,83 +19,83 @@4: 'tour_listening', 5: 'tour_shipping', 6: 'tour_directline'} -%}{{ ui.hero(TOUR_HEROES[part]) }}<tr><td bgcolor="#ffffff" style="border-radius:0 0 16px 16px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">{%- if part == 1 %}-{% call ui.eyebrow(color='#5635b2') %}PART 1 OF {{ of }} · GETTING STARTED{% endcall %}-{% call ui.headline() %}Welcome — let's get you your first win{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — welcome aboard, and thank you for subscribing. You now have the full platform, and over the next two weeks I'll send you a short tour: one email at a time, each with something real you can do in a couple of minutes.{% endcall %}-{% call ui.para() %}I'm John, and I work on product here. You can reply to any of these emails and it comes straight to me — that's not a support queue, it's my inbox.{% endcall %}-{% call ui.para(top=22) %}<strong style="color:#070629;">Your first win, in 2 minutes:</strong>{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 1 OF {{ of }} · GETTING STARTED{% endcall %}+{% call ui.headline() %}Welcome. Let's get you your first win{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, welcome aboard, and thank you for subscribing. You now have the full platform, and over the next two weeks I'll send you a short tour: one email at a time, each with something real you can do in a couple of minutes.{% endcall %}+{% call ui.para() %}I'm John, and I work on product here. You can reply to any of these emails and it reaches our shared inbox, where our team reads replies.{% endcall %}+{% call ui.para(top=22) %}<strong style="color:#171925;">Your first win, in 2 minutes:</strong>{% endcall %}{{ ui.steps([('Open Otto.', "It's the first thing you see when you log in."),('Describe a task in plain language.', 'Try: "Research the top 5 competitors in my space and summarize their pricing."'),- ('Watch it work.', 'Otto figures out the steps, runs them, and delivers the result — while you do something else.'),+ ('Watch it work.', 'Otto figures out the steps, runs them, and delivers the result while you do something else.'),]) }}{{ ui.cta('Open Otto', urls.chat) }}-{{ ui.media_link('A quick welcome from our founder', '90 seconds on why we built this — and what we hope you do with it.', urls.founder_video) }}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: the five workflows our users run most — steal them.{% endcall %}+{{ ui.media_link('A quick welcome from our founder', '90 seconds on why we built this and what we hope you do with it.', urls.founder_video) }}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: the five workflows our users run most. Steal them.{% endcall %}{%- elif part == 2 %}-{% call ui.eyebrow(color='#5635b2') %}PART 2 OF {{ of }} · FIRST WORKFLOWS{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 2 OF {{ of }} · FIRST WORKFLOWS{% endcall %}{% call ui.headline() %}5 tasks you can hand to Otto today{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — the best way to get value out of AutoGPT isn't to explore menus. It's to hand it something from your actual to-do list. Here are five workflows that ran start-to-finish in our demo, with zero hand-holding:{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, the best way to get value out of AutoGPT isn't to explore menus. It's to hand it something from your actual to-do list. Here are five workflows that ran start-to-finish in our demo, with zero hand-holding:{% endcall %}{{ ui.emoji_cards([('🖥', 'Engineering & bug triage', 'Connected to Sentry, ranked bugs by impact, pushed sprint actions to Linear, and notified the team on Discord.'),('📦', 'End-to-end marketing', 'Pulled release notes from GitHub, wrote a changelog email in our brand voice, and built it in send-ready HTML.'),('📈', 'Strategy & competitive intel', 'Analyzed 13 competitors, built a SWOT with threat scores, and delivered an interactive strategy report.'),- ('🔍', 'Talent sourcing & outreach', 'Took a job description, sourced and scored candidates, and wrote personalized outreach — ready to send.'),+ ('🔍', 'Talent sourcing & outreach', 'Took a job description, sourced and scored candidates, and wrote personalized outreach, ready to send.'),('🎯', 'Sales funnel & demo prep', 'Found leads matching our ICP, built curated demo agents, and wrote scripts and follow-up questions.'),]) }}-{{ ui.media_link('Watch all five in 6 minutes', 'Everything in the demo ran autonomously — and these five are just what fit in six minutes.', urls.demo_video) }}-{% call ui.para() %}Pick the one closest to your work, open Otto, and describe it in your own words. That's it — no setup, no flowcharts.{% endcall %}+{{ ui.media_link('Watch all five in 6 minutes', 'Everything in the demo ran autonomously, and these five are just what fit in six minutes.', urls.demo_video) }}+{% call ui.para() %}Pick the one closest to your work, open Otto, and describe it in your own words. That's it. No setup, no flowcharts.{% endcall %}{{ ui.cta('Try a workflow', urls.chat) }}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: a tour of your workspace — artifacts, briefings, and the builder.{% endcall %}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: a tour of your workspace: artifacts, briefings, and the builder.{% endcall %}{%- elif part == 3 %}-{% call ui.eyebrow(color='#5635b2') %}PART 3 OF {{ of }} · KNOW YOUR WORKSPACE{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 3 OF {{ of }} · KNOW YOUR WORKSPACE{% endcall %}{% call ui.headline() %}A quick tour of your workspace{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — now that you've run a task or two, here's what the rest of your workspace does for you. Three things worth knowing about, so you know them when you see them:{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, now that you've run a task or two, here's what the rest of your workspace does for you. Three things worth knowing about, so you know them when you see them:{% endcall %}{{ ui.emoji_cards([('🎨', 'Artifacts, right in the conversation', 'Reports open as interactive documents, charts render live, and PDFs are readable in a side panel. No downloads, no tab-juggling.'),('📋', 'Agent briefings at a glance', "Your Home screen shows a live briefing for each agent: what it's doing, what it finished, and what's next. Scheduled agents surface their upcoming runs automatically."),- ('💬', 'Chat with your builder', 'Building a custom workflow? The flow builder has its own AI chat panel that knows your graph and helps you debug or extend it — without switching context.'),+ ('💬', 'Chat with your builder', 'Building a custom workflow? The flow builder has its own AI chat panel that knows your graph and helps you debug or extend it without switching context.'),]) }}{{ ui.cta('Open AutoGPT', urls.dashboard) }}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: a quick personal check-in from me. No screenshots, no buttons — just a question.{% endcall %}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: a quick personal check-in from me. No screenshots, no buttons. Just a question.{% endcall %}{%- elif part == 4 %}-{% call ui.eyebrow(color='#5635b2') %}PART 4 OF {{ of }} · JUST A QUESTION{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 4 OF {{ of }} · JUST A QUESTION{% endcall %}{% call ui.headline() %}How's it going so far?{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — quick one from me. No screenshots, no buttons.{% endcall %}-{% call ui.para() %}You've had AutoGPT for a week now. <strong style="color:#070629;">How's it actually going?</strong> Did something click? Did something get in your way?{% endcall %}-{% call ui.para() %}I ask because we're a small team, we ship every week, and the roadmap is genuinely shaped by what subscribers tell us. If Otto mis-handled a task, or there's a feature you keep wishing existed, I want to know about it — the unpolished version is the most useful version.{% endcall %}-{% call ui.para() %}<strong style="color:#070629;">Just hit reply.</strong> It comes straight to me, and I read every single one.{% endcall %}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}P.S. If it's easier: here's a <a href="{{ urls.feedback_form }}" style="color:#5635b2; text-decoration:underline;">2-minute feedback form</a>, or <a href="{{ urls.booking }}" style="color:#5635b2; text-decoration:underline;">book 30 minutes with me</a> — no agenda needed.{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, quick one from me. No screenshots, no buttons.{% endcall %}+{% call ui.para() %}You've had AutoGPT for a week now. <strong style="color:#171925;">How's it actually going?</strong> Did something click? Did something get in your way?{% endcall %}+{% call ui.para() %}I ask because we're a small team, we ship every week, and the roadmap is genuinely shaped by what subscribers tell us. If Otto mis-handled a task, or there's a feature you keep wishing existed, I want to know about it. The unpolished version is the most useful version.{% endcall %}+{% call ui.para() %}<strong style="color:#171925;">Just hit reply.</strong> It comes straight to me, and I read every single one.{% endcall %}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}P.S. If it's easier: here's a <a href="{{ urls.feedback_form }}" style="color:#6144DF; text-decoration:underline;">2-minute feedback form</a>, or <a href="{{ urls.booking }}" style="color:#6144DF; text-decoration:underline;">book 30 minutes with me</a>. No agenda needed.{% endcall %}{%- elif part == 5 %}-{% call ui.eyebrow(color='#5635b2') %}PART 5 OF {{ of }} · ALWAYS SHIPPING{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 5 OF {{ of }} · ALWAYS SHIPPING{% endcall %}{% call ui.headline() %}We shipped while you were reading this{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — one thing subscribers tell us they didn't expect: the pace. We ship improvements every week, and everything lands in the public changelog — so you always know what's new and what your feedback turned into.{% endcall %}-{% call ui.para(top=22) %}<strong style="color:#070629;">Shipped in the last few weeks:</strong>{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, one thing subscribers tell us they didn't expect: the pace. We ship improvements every week, and everything lands in the public changelog, so you always know what's new and what your feedback turned into.{% endcall %}+{% call ui.para(top=22) %}<strong style="color:#171925;">Shipped in the last few weeks:</strong>{% endcall %}{{ ui.emoji_cards([- ('🎨', 'Rich artifacts in a side panel', 'Reports, charts, PDFs — even playable games — open right beside the conversation.'),+ ('🎨', 'Rich artifacts in a side panel', 'Reports, charts, PDFs, and even playable games open right beside the conversation.'),('📋', 'Live agent briefings', 'On your Home screen, with upcoming run times for every scheduled agent.'),('💬', 'An AI chat panel inside the flow builder', 'It knows your graph and helps you debug or extend it.'),- ('🔔', 'Web push notifications', 'Plus long-term memory blocks and the latest models — Claude Opus 4.7 and Grok.'),+ ('🔔', 'Web push notifications', 'Plus long-term memory blocks and the latest models: Claude Opus 4.7 and Grok.'),]) }}{{ ui.cta("See what's new", urls.changelog) }}{% call ui.para() %}The best part of shipping weekly: your feedback doesn't sit in a backlog for a year. The Give Feedback button inside the app goes to the same board we plan our sprints from.{% endcall %}-{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: the last email of the tour — and the most important one.{% endcall %}+{% call ui.para(color='#575072', size=13, lh=20, top=18) %}Next up: the last email of the tour, and the most important one.{% endcall %}{%- else %}-{% call ui.eyebrow(color='#5635b2') %}PART 6 OF {{ of }} · YOU'RE IN{% endcall %}+{% call ui.eyebrow(tone='brand') %}PART 6 OF {{ of }} · YOU'RE IN{% endcall %}{% call ui.headline() %}Your direct line to the team{% endcall %}-{% call ui.para() %}Hi {{ user_name }} — that's the end of the tour. You know your way around Otto, your workspace, and everything we ship weekly. From here on we mostly stay out of your inbox: you'll hear from us when there's something genuinely new.{% endcall %}-{% call ui.para(top=22) %}<strong style="color:#070629;">Before I go, three things worth keeping:</strong>{% endcall %}+{% call ui.para() %}Hi {{ user_name }}, that's the end of the tour. You know your way around Otto, your workspace, and everything we ship weekly. From here on we mostly stay out of your inbox: you'll hear from us when there's something genuinely new.{% endcall %}+{% call ui.para(top=22) %}<strong style="color:#171925;">Before I go, three things worth keeping:</strong>{% endcall %}{{ ui.emoji_cards([- ('💬', 'The community', "5,000+ builders share what they're automating in our Discord. The team is in there daily — it's the fastest way to get unstuck."),- ('📝', 'The feedback form', "Two minutes, and it directly shapes the roadmap — what's working, what's not, what you wish existed."),+ ('💬', 'The community', "5,000+ builders share what they're automating in our Discord. The team is in there daily. It's the fastest way to get unstuck."),+ ('📝', 'The feedback form', "Two minutes, and it directly shapes the roadmap: what's working, what's not, what you wish existed."),('📅', 'A call with me', "If you'd rather talk it through: 30 minutes, no agenda. I'd love to hear what you're building and what you need from us."),]) }}{% call ui.para() %}We built AutoGPT to be the business partner you always needed. Thanks for giving us the chance to prove it.{% endcall %}{{ ui.cta('Join the Discord', urls.discord) }}{%- endif %}-{{ ui.signature('John Ababseh', 'Product Manager · AutoGPT', '[email protected]') }}+{{ ui.signature('John Ababseh', 'Head of Product · AutoGPT', '[email protected]') }}{{ ui.close_row('Email ' ~ part ~ ' of ' ~ of ~ ' in the getting-started tour · day ' ~ day ~ '.', 'Choose which emails you get', urls.prefs) }}</table></td></tr>diff --git a/autogpt_platform/backend/backend/notifications/templates/onboarding.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/onboarding.subject.j2index d1651386df..df36b8cbd5 100644--- a/autogpt_platform/backend/backend/notifications/templates/onboarding.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/onboarding.subject.j2@@ -1,7 +1,7 @@-{% if part == 1 %}Welcome to AutoGPT — let's get you your first win+{% if part == 1 %}Welcome to AutoGPT: let's get you your first winYou're all set up. Here's the 2-minute path to your first task, done for you.{% elif part == 2 %}5 tasks you can hand to Otto todayReal workflows from real users. Steal the prompts and make them yours.{% elif part == 3 %}A quick tour of your workspaceArtifacts, agent briefings, and an AI copilot inside the builder.{% elif part == 4 %}How's it going so far?-A real question from a real person. Hit reply — it comes straight to me.{% elif part == 5 %}We shipped while you were reading this-Weekly releases, a public changelog, and your feedback steering it all.{% else %}You made it — here's your direct line to the team+A real question from a real person. Hit reply: it comes straight to me.{% elif part == 5 %}We shipped while you were reading this+Weekly releases, a public changelog, and your feedback steering it all.{% else %}You made it: here's your direct line to the teamThe tour is done. The conversation isn't. Discord, feedback, or a call with me.{% endif %}diff --git a/autogpt_platform/backend/backend/notifications/templates/ops.html.j2 b/autogpt_platform/backend/backend/notifications/templates/ops.html.j2index 078bdf52ca..3284ab9f33 100644--- a/autogpt_platform/backend/backend/notifications/templates/ops.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/ops.html.j2@@ -1,135 +1,39 @@-{#- ============================================================- ops.html.j2 — internal refund mail (REFUND_REQUEST / REFUND_PROCESSED)- Goes to the refunds alias, not to a customer. So: no mascot hero,- no Discord, no unsubscribe (it is not opt-in mail), no marketing- voice. The amount is the hero because that is the number the- person on call is deciding about.- kind: 'request' | 'processed'- ============================================================ -#}-{%- import "_ui.j2" as ui with context -%}-{%- set is_request = (kind == 'request') -%}+{%- import "_email_ui.j2" as ui with context -%}+{%- set is_request = kind == 'request' -%}{%- set amount_str = '$' ~ '{:,.2f}'.format(amount_cents / 100) -%}{%- set balance_str = '$' ~ '{:,.2f}'.format(balance_cents / 100) -%}-{%- set headline = ('Approve or reject a ' ~ amount_str ~ ' refund') if is_request else (amount_str ~ ' refunded to ' ~ ui.trunc(user_name, 40)) -%}<!doctype html><html lang="en">-<head>-{{ ui.head_block(subject | default(headline)) }}-</head>-<body style="margin:0; padding:0; background-color:#f1efe9; -webkit-text-size-adjust:100%; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">-{{ ui.preheader(preheader | default(headline)) }}+<head>{{ ui.head_block(subject) }}</head>+{{ ui.body_open() }}+{{ ui.preheader(preheader) }}{{ ui.page_open() }}-{{ ui.header() }}-{{ ui.ops_band(- 'REFUND REQUEST' if is_request else 'REFUND PROCESSED',- amount_str,- ui.trunc(user_name, 30) ~ ' · ' ~ ui.trunc(user_email, 30),- ('Needs a decision · raised ' ~ age_label) if (is_request and age_label) else ('Needs a decision' if is_request else 'Completed — no action needed'),- '#f5a623' if is_request else '#4ade80') }}-- <!-- Body card -->- <tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-- <tr><td class="gutter" style="padding:26px 44px 0;">- <div style="font-size:16px; line-height:26px; color:#3b3757;">- {%- if is_request %}- {{ ui.trunc(user_name, 40) }} asked for {{ amount_str }} back on {{ requested_at_label }}.- Their balance right now is {{ balance_str }}.- {%- else %}- {{ amount_str }} was refunded to {{ ui.trunc(user_name, 40) }} on {{ processed_at_label }}- and the credits have been deducted. Their balance is now {{ balance_str }}.- This is a record for the log — nothing is waiting on you.- {%- endif %}- </div>- </td></tr>-- <!-- Why -->- {%- if reason and reason | trim | length > 0 %}- <tr><td class="gutter" style="padding:22px 44px 0;">- {{ ui.note_card('In their words', reason, 'neutral') }}- </td></tr>- {%- else %}- <tr><td class="gutter" style="padding:18px 44px 0;">- <div style="font-size:14px; line-height:22px; color:#8a86a3;">- No reason was given with this request{{ ', so ask before deciding.' if is_request else '.' }}- </div>- </td></tr>- {%- endif %}-- <!-- Ledger -->- <tr><td class="gutter" style="padding:22px 44px 0;">- {{ ui.section_label('THE RECORD') }}- </td></tr>- <tr><td class="gutter" style="padding:12px 44px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:14px 18px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- {{ ui.kv('Customer', user_name, mono=false, first=true) }}- {{ ui.kv('Email', user_email, mono=true) }}- {{ ui.kv('User ID', user_id, mono=true) }}- {{ ui.kv('Transaction', transaction_id, mono=true) }}- {{ ui.kv('Request ID', refund_request_id, mono=true) }}- {{ ui.kv('Balance ' ~ ('now' if is_request else 'after refund'), balance_str, mono=true) }}- </table>- </td></tr>- </table>- </td></tr>-- {%- if is_request %}- <!-- Decision -->- <tr><td class="gutter" style="padding:26px 44px 0;">- {{ ui.section_label('TO APPROVE') }}- </td></tr>- <tr><td class="gutter" style="padding:14px 44px 0;">- <div style="font-size:14px; line-height:22px; color:#494566; padding-bottom:13px;">- Issue the refund in Stripe. The balance adjustment on our side happens automatically once Stripe confirms.- </div>- {{ ui.btn('Refund ' ~ amount_str ~ ' in Stripe', stripe_url) }}- </td></tr>-- <tr><td class="gutter" style="padding:26px 44px 0;">- {{ ui.section_label('TO REJECT') }}- </td></tr>- <tr><td class="gutter" style="padding:14px 44px 0;">- <div style="font-size:14px; line-height:22px; color:#494566; padding-bottom:11px;">- Open the request in the admin panel, mark it rejected, and write the reason — the customer sees what you write.- </div>- <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>- <td style="border:1px solid #d9d5ec; border-radius:8px;">- <a href="{{ admin_url }}" style="display:inline-block; padding:11px 20px; font-size:14px; font-weight:700; color:#5d23bb;">Open in the admin panel</a>- </td>- </tr></table>- </td></tr>- {%- else %}- <tr><td class="gutter" style="padding:22px 44px 0;">- <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>- <td style="border:1px solid #d9d5ec; border-radius:8px;">- <a href="{{ stripe_url }}" style="display:inline-block; padding:11px 20px; font-size:14px; font-weight:700; color:#5d23bb;">View the transaction in Stripe</a>- </td>- </tr></table>- </td></tr>- {%- endif %}-- <tr><td align="center" class="gutter" style="padding:26px 44px 30px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr><td height="1" bgcolor="#eeecf5" style="font-size:0; line-height:0;"> </td></tr>- <tr><td align="center" style="padding-top:14px; font-size:12px; line-height:19px; color:#8a86a3;">- {%- if is_request %}- This request stays open until someone acts on it. If two of you are looking, the admin panel shows who claimed it.- {%- else %}- Filed automatically when Stripe confirmed the refund.- {%- endif %}- </td></tr>- </table>- </td></tr>-- </table>- </td></tr>+{{ ui.masthead() }}+{{ ui.ops_band('REFUND REQUEST' if is_request else 'REFUND PROCESSED', amount_str,+ user_name ~ ' · ' ~ user_email,+ ('Needs a decision · raised ' ~ age_label) if is_request and age_label else ('Needs a decision' if is_request else 'Completed · no action needed'),+ '#FFF6E8' if is_request else '#F5F3FC') }}+{{ ui.sheet_open() }}+{% call ui.para() %}+{% if is_request %}{{ user_name }} asked for {{ amount_str }} back on {{ requested_at_label }}.{% else %}{{ amount_str }} was refunded to {{ user_name }} on {{ processed_at_label }}.{% endif %}+{{ preheader }}+{% endcall %}+{% if reason and reason | trim | length > 0 %}+{{ ui.note_card('In their words', reason) }}+{% else %}+{% call ui.para() %}No reason was given with this request{{ ', so ask before deciding.' if is_request else '.' }}{% endcall %}+{% endif %}+{{ ui.kvpanel([('Customer', user_name, false), ('Email', user_email, true), ('User ID', user_id, true), ('Transaction', transaction_id, true), ('Request ID', refund_request_id, true), ('Balance now' if is_request else 'Balance after refund', balance_str, true)]) }}+{% if is_request %}+{% call ui.para() %}To approve, <a href="{{ stripe_url }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">refund {{ amount_str }} in Stripe</a>. The balance adjustment happens automatically once Stripe confirms.{% endcall %}+{% call ui.para() %}To reject, open the request in the admin panel, mark it rejected, and write the reason. The customer sees what you write.{% endcall %}+{% else %}+{% call ui.para() %}The credits have been deducted. <a href="{{ stripe_url }}" style="color:#6144DF; font-weight:600; text-decoration:underline;">View the transaction in Stripe</a>.{% endcall %}+{% endif %}+{{ ui.cta('Open in the admin panel', admin_url) }}+{{ ui.close_row('This request stays open until someone acts on it.' if is_request else 'Filed automatically when Stripe confirmed the refund.', 'View the transaction in Stripe', stripe_url) }}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{{ ui.internal_footer('Internal notification for the AutoGPT refunds team — sent to ' ~ recipient ~ '. Not customer-facing.') }}--</td></tr>-</table>-</body>-</html>+{{ ui.internal_footer('Internal notification for the AutoGPT refunds team. Not customer-facing. Sent to ' ~ recipient ~ '.') }}+</td></tr></table>+</body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/ops.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/ops.subject.j2index 2bd527f5b1..e6acfa9e9e 100644--- a/autogpt_platform/backend/backend/notifications/templates/ops.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/ops.subject.j2@@ -1,17 +1,10 @@-{#- Two lines: subject, then preheader. Amount leads, because that is what the- person on call triages by. -#}-{%- set is_request = (kind == 'request') -%}+{%- import "_email_ui.j2" as ui -%}{%- set amount_str = '$' ~ '{:,.2f}'.format(amount_cents / 100) -%}{%- set balance_str = '$' ~ '{:,.2f}'.format(balance_cents / 100) -%}-{%- import "_ui.j2" as ui -%}-{%- set name = ui.trunc(user_name, 38) -%}-{%- set has_reason = reason and reason | trim | length > 0 -%}-{%- set r = (reason | trim | replace('\n', ' ')) if has_reason else '' -%}-{%- set r_short = ui.trunc(r, 105) -%}-{%- if is_request -%}-Refund needs a decision: {{ amount_str }} for {{ name }}-{% if has_reason %}{{ r_short }}{% else %}No reason given. Balance now {{ balance_str }}.{% endif %}+{%- if kind == 'request' -%}+Refund needs a decision: {{ amount_str }} for {{ ui.trunc(user_name, 38) }}+Their balance right now is {{ balance_str }}.{%- else -%}-Refunded {{ amount_str }} to {{ name }}-{% if has_reason %}{{ r_short }}{% else %}Balance after refund {{ balance_str }}. Logged, nothing to do.{% endif %}+Refunded {{ amount_str }} to {{ ui.trunc(user_name, 38) }}+Their balance after the refund is {{ balance_str }}.{%- endif -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/ops.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/ops.txt.j2index 82f3fb4d1d..d602c4e397 100644--- a/autogpt_platform/backend/backend/notifications/templates/ops.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/ops.txt.j2@@ -3,7 +3,7 @@{%- set is_request = (kind == 'request') -%}{%- set amount_str = '$' ~ '{:,.2f}'.format(amount_cents / 100) -%}{%- set balance_str = '$' ~ '{:,.2f}'.format(balance_cents / 100) -%}-{{ 'REFUND REQUEST' if is_request else 'REFUND PROCESSED' }}{% if age_label %} - RAISED {{ age_label }}{% endif %}+{{ 'REFUND REQUEST' if is_request else 'REFUND PROCESSED' }}{% if is_request and age_label %} · RAISED {{ age_label }}{% endif %}{{ amount_str }}@@ -11,10 +11,10 @@{% if is_request %}{{ user_name }} asked for {{ amount_str }} back on {{ requested_at_label }}.-Their balance right now is {{ balance_str }}.+{{ preheader }}{% else %}{{ amount_str }} was refunded to {{ user_name }} on {{ processed_at_label }} and the-credits have been deducted. Their balance is now {{ balance_str }}.+credits have been deducted. {{ preheader }}{% endif %}{% if reason and reason | trim | length > 0 %}@@ -36,14 +36,20 @@ Balance {{ 'now' if is_request else 'after refund' }}: {{ balance_str }}TO APPROVERefund {{ amount_str }} in Stripe: {{ stripe_url }}+The balance adjustment happens automatically once Stripe confirms.TO REJECTOpen in the admin panel: {{ admin_url }}+Mark the request rejected and write the reason. The customer sees what you write.{% else %}View the transaction in Stripe: {{ stripe_url }}+Open in the admin panel: {{ admin_url }}{% endif %}---Internal notification for the AutoGPT refunds team - sent to {{ recipient }}.-Not customer-facing.+{{ 'This request stays open until someone acts on it.' if is_request else 'Filed automatically when Stripe confirmed the refund.' }}+View the transaction in Stripe: {{ stripe_url }}++Internal notification for the AutoGPT refunds team. Not customer-facing. Sent to {{ recipient }}.+AutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKdiff --git a/autogpt_platform/backend/backend/notifications/templates/trial.html.j2 b/autogpt_platform/backend/backend/notifications/templates/trial.html.j2index 80d9882830..438c0ab7f7 100644--- a/autogpt_platform/backend/backend/notifications/templates/trial.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/trial.html.j2@@ -1,41 +1,24 @@-{%- import "_lifecycle_ui.j2" as ui with context -%}+{%- import "_email_ui.j2" as ui with context -%}+{%- import "_trial_copy.j2" as copy with context -%}<!doctype html><html lang="en"><head>{{ ui.head_block(subject) }}</head>-<body style="margin:0; padding:0; background-color:#f1efe9; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">+{{ ui.body_open() }}{{ ui.preheader(preheader) }}{{ ui.page_open() }}{{ ui.masthead() }}-<tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">-<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-{% call ui.eyebrow() %}YOUR AUTOGPT TRIAL{% endcall %}+{{ ui.hero_otto() }}+{{ ui.sheet_open() }}+{% if kind == 'payment_failed' %}{{ ui.strip_amber('NEEDS YOU · PAYMENT DECLINED') }}{% endif %}+{% call ui.eyebrow(tone='confirmed' if kind in ['started', 'resumed', 'converted'] else 'needs_you' if kind == 'payment_failed' else 'neutral') %}YOUR AUTOGPT TRIAL{% endcall %}{% call ui.headline() %}{{ subject }}{% endcall %}-{% call ui.para() %}Hi {{ user_name }},{% endcall %}-{% if kind == 'started' %}-{% call ui.para() %}Your card is set up and your trial is ready. Pick a real task, connect the accounts it needs, and give AutoGPT a first run.{% endcall %}-{% elif kind == 'ending' %}-{% call ui.para() %}Your trial ends on {{ ends_label }}. Unless you cancel before then, your saved card will be charged for your {{ plan.name }} plan at {{ plan.price_display }}. Applicable tax may be added.{% endcall %}-{% elif kind == 'canceled' %}-{% call ui.para() %}Your trial will not convert to a paid plan. You can keep using your remaining trial allowance until {{ ends_label }}.{% endcall %}-{% elif kind == 'resumed' %}-{% call ui.para() %}Your cancellation has been removed. Your saved card will be charged for your {{ plan.name }} plan when the trial ends on {{ ends_label }}. Applicable tax may be added.{% endcall %}-{% elif kind == 'converted' %}-{% call ui.para() %}Your trial has ended, your payment is confirmed, and your {{ plan.name }} plan is active. You can view the invoice and manage future renewals in billing.{% endcall %}-{% elif kind == 'payment_failed' %}-{% call ui.para() %}We couldn't complete the payment after your trial. Your paid access is paused until payment succeeds. Open billing to update your card or complete any verification requested by your bank.{% endcall %}-{% else %}-{% call ui.para() %}Your trial access has ended. Your saved work remains in your account. Open billing to review your plan and payment status if you'd like to continue.{% endcall %}-{% endif %}+{% call ui.para() %}{{ copy.lede() }}{% endcall %}{{ ui.kvpanel([('Plan', plan.label, false), ('Trial ends', ends_label, true), ('Paid price', plan.price_display, true)]) }}-{% if kind == 'started' %}-{% call ui.para() %}Unless you cancel before {{ ends_label }}, your plan starts automatically at {{ plan.price_display }}. Applicable tax may be added. Trial access is subject to your trial allowance.{% endcall %}-{{ ui.cta('Start using AutoGPT', urls.dashboard) }}-{% endif %}-{{ ui.cta('Manage trial and billing', urls.billing) }}-{{ ui.close_row('Review your plan or cancel in billing settings.', 'Billing settings', urls.billing) }}- </table>- </td></tr>+{% if copy.detail() | trim %}{% call ui.para() %}{{ copy.detail() }}{% endcall %}{% endif %}+{{ ui.cta('Update payment method' if kind == 'payment_failed' else 'Review your plan', urls.billing) }}+{{ ui.close_row('You received this because your trial status changed or its end is approaching.', 'Billing settings', urls.billing) }}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{{ ui.legal_footer('This is a service message about the AutoGPT account for ' ~ user_email ~ '.', 'Email preferences', urls.prefs, discord=false) }}+{{ ui.legal_footer("This is a service message about the AutoGPT account for " ~ user_email ~ ". It's sent even if you've opted out of product news.", 'Email preferences', urls.prefs, discord=true) }}</td></tr></table></body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/trial.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/trial.subject.j2index 4c96e85ef8..4b0fedfde1 100644--- a/autogpt_platform/backend/backend/notifications/templates/trial.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/trial.subject.j2@@ -1,15 +1,15 @@{% if kind == 'started' %}Your AutoGPT trial has started-Your trial ends {{ ends_label }}. Review your plan and next steps.-{% elif kind == 'ending' %}Your AutoGPT trial ends {{ ends_label }}-Your {{ plan.name }} plan starts at {{ plan.price_display }} unless you cancel.+Your trial allowance is available until {{ ends_label }}.+{% elif kind == 'ending' %}Your AutoGPT trial ends on {{ ends_label }}+Unless you cancel before then, your saved card will be charged for your {{ plan.name }} plan at {{ plan.price_display }}.{% elif kind == 'canceled' %}Your AutoGPT trial cancellation is confirmed-Your trial will not convert to a paid plan.+You can keep using your remaining trial allowance until {{ ends_label }}.{% elif kind == 'resumed' %}Your AutoGPT trial will continue into your plan-Your {{ plan.name }} plan starts {{ ends_label }} at {{ plan.price_display }}.+Your saved card will be charged for your {{ plan.name }} plan on {{ ends_label }} at {{ plan.price_display }}.{% elif kind == 'converted' %}Your AutoGPT {{ plan.name }} plan is active-Your trial has ended and your payment is confirmed.+You can view the invoice and manage future renewals in billing.{% elif kind == 'payment_failed' %}Action needed: your AutoGPT trial payment-Your trial has ended. Update your payment method to activate your plan.+Your paid access is paused until payment succeeds.{% else %}Your AutoGPT trial has ended-Review your billing settings to continue using AutoGPT.+Your saved work remains in your account.{% endif %}diff --git a/autogpt_platform/backend/backend/notifications/templates/trial.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/trial.txt.j2index 4507b37bad..c2739f631f 100644--- a/autogpt_platform/backend/backend/notifications/templates/trial.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/trial.txt.j2@@ -1,29 +1,21 @@+{%- import "_trial_copy.j2" as copy with context -%}{{ subject }}-Hi {{ user_name }},--{% if kind == 'started' %}-Your card is set up and your trial is ready. Pick a real task and give AutoGPT a first run.-Unless you cancel before {{ ends_label }}, your plan starts automatically at {{ plan.price_display }}. Applicable tax may be added. Trial access is subject to your trial allowance.-{% elif kind == 'ending' %}-Your trial ends {{ ends_label }}. Unless you cancel before then, your saved card will be charged {{ plan.price_display }} for your {{ plan.name }} plan. Applicable tax may be added.-{% elif kind == 'canceled' %}-Your trial will not convert to a paid plan. You can keep using your remaining trial allowance until {{ ends_label }}.-{% elif kind == 'resumed' %}-Your cancellation has been removed. Your saved card will be charged for your {{ plan.name }} plan when the trial ends {{ ends_label }}. Applicable tax may be added.-{% elif kind == 'converted' %}-Your trial has ended, your payment is confirmed, and your {{ plan.name }} plan is active. View your invoice and manage future renewals in billing.-{% elif kind == 'payment_failed' %}-We couldn't complete the payment after your trial. Your paid access is paused until payment succeeds. Open billing to update your card or complete verification requested by your bank.-{% else %}-Your trial access has ended. Your saved work remains in your account. Open billing to review your plan and payment status if you'd like to continue.-{% endif %}+{{ copy.lede() }}Plan: {{ plan.label }}Trial ends: {{ ends_label }}Paid price: {{ plan.price_display }}-Manage trial and billing: {{ urls.billing }}+{{ copy.detail() }}++{{ 'Update payment method' if kind == 'payment_failed' else 'Review your plan' }}: {{ urls.billing }}+You received this because your trial status changed or its end is approaching.+Billing settings: {{ urls.billing }}This is a service message about the AutoGPT account for {{ user_email }}.+It's sent even if you've opted out of product news.Email preferences: {{ urls.prefs }}+Discord: {{ urls.discord }}+AutoGPT: https://agpt.co+AutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKdiff --git a/autogpt_platform/backend/backend/notifications/templates/verdict.html.j2 b/autogpt_platform/backend/backend/notifications/templates/verdict.html.j2index b6e759d83c..854457969c 100644--- a/autogpt_platform/backend/backend/notifications/templates/verdict.html.j2+++ b/autogpt_platform/backend/backend/notifications/templates/verdict.html.j2@@ -1,153 +1,38 @@-{#- ============================================================- verdict.html.j2 — Store submission review outcome- Covers AGENT_APPROVED and AGENT_REJECTED via `outcome`.- The reviewer's comment is the payload of this email, so on a- changes-needed verdict it is the most prominent block, above- the fold, never truncated.- ============================================================ -#}-{%- import "_ui.j2" as ui with context -%}-{%- set approved = (outcome == 'approved') -%}+{%- import "_email_ui.j2" as ui with context -%}+{%- set approved = outcome == 'approved' -%}{%- set has_note = comments and comments | trim | length > 0 -%}-{%- set resubmission = (version | default(1)) > 1 -%}-{%- if approved -%}- {%- set headline = ui.trunc(agent_name, 44) ~ ' is live in the Store' -%}-{%- else -%}- {%- set headline = ui.trunc(agent_name, 40) ~ ' needs one more pass' -%}-{%- endif -%}<!doctype html><html lang="en">-<head>-{{ ui.head_block(subject | default(headline)) }}-</head>-<body style="margin:0; padding:0; background-color:#f1efe9; -webkit-text-size-adjust:100%; font-family:-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;">-{{ ui.preheader(preheader | default(headline)) }}+<head>{{ ui.head_block(subject) }}</head>+{{ ui.body_open() }}+{{ ui.preheader(preheader) }}{{ ui.page_open() }}-{{ ui.header() }}-{{ ui.hero_verdict('approved' if approved else 'changes') }}-- <!-- Body card -->- <tr><td bgcolor="#ffffff" style="border-radius:0 0 14px 14px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">-- <tr><td class="gutter" style="padding:30px 48px 0;">- <div style="font-size:12px; font-weight:800; letter-spacing:2.2px; color:{{ '#1c7a52' if approved else '#b45309' }};">- STORE REVIEW · VERSION {{ version | default(1) }}{% if not approved %} · CHANGES NEEDED{% endif %}- </div>- <div class="headline" style="padding-top:10px; font-size:26px; line-height:34px; font-weight:800; color:#17123b; overflow-wrap:anywhere;">- {{ headline }}- </div>- </td></tr>-- <tr><td class="gutter" style="padding:16px 48px 0;">- <div style="font-size:15px; line-height:24px; color:#494566;">- {%- if approved %}- {{ reviewer_name }} approved version {{ version | default(1) }} on {{ reviewed_at_label }}.- Anyone browsing the Store can now find it, install it, and run it.- {%- else %}- {{ reviewer_name }} reviewed version {{ version | default(1) }} on {{ reviewed_at_label }} and found something to fix- before it can go live.- {{ 'Your submission is saved — you are picking up where you left off, not starting over.' if resubmission else 'Nothing is lost: your submission is saved and you can resubmit as soon as it is fixed.' }}- {%- endif %}- </div>- </td></tr>-- {#- On a changes verdict the feedback is the reason the email exists, so it- comes before the CTA. On an approval it is a nice-to-have and only- renders when the reviewer actually wrote something. -#}- {%- if not approved %}- {%- if changes %}- <tr><td class="gutter" style="padding:22px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#fff6e8" style="border:1px solid #f2dcb0; border-left:4px solid #e8940a; border-radius:10px;">- <tr><td style="padding:16px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#8a5800; padding-bottom:10px;">- {{ changes | length }} {{ 'THING' if changes | length == 1 else 'THINGS' }} TO CHANGE- </div>- {%- for c in changes %}- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="{{ '' if loop.first else 'margin-top:10px;' }}">- <tr>- <td width="26" valign="top" style="font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:23px; font-weight:bold; color:#b45309;">{{ loop.index }}</td>- <td style="font-size:15px; line-height:23px; color:#3b3757; overflow-wrap:anywhere;">{{ c }}</td>- </tr>- </table>- {%- endfor %}- {%- if closing_note %}- <div style="padding-top:12px; margin-top:12px; border-top:1px solid #f2dcb0; font-size:14px; line-height:22px; color:#6b5426;">{{ closing_note }}</div>- {%- endif %}- </td></tr>- </table>- </td></tr>- {%- else %}- <tr><td class="gutter" style="padding:22px 48px 0;">- {{ ui.note_card('What needs to change', comments if has_note else 'The reviewer did not leave a written note. Reply to this email and it goes straight to them.', 'amber') }}- </td></tr>- {%- endif %}- {%- elif has_note %}- <tr><td class="gutter" style="padding:22px 48px 0;">- {{ ui.note_card('Note from ' ~ reviewer_name, comments, 'neutral') }}- </td></tr>- {%- endif %}-- <tr><td class="gutter" style="padding:24px 48px 0;">- {%- if approved %}- {{ ui.btn('View it in the Store', store_url) }}- {%- else %}- {{ ui.btn('Update and resubmit', resubmit_url) }}- <div style="padding-top:10px; font-size:12px; color:#8a86a3;">Re-reviews usually take under two working days</div>- {%- endif %}- </td></tr>-- {%- if approved %}- {%- if share_url %}- <tr><td class="gutter" style="padding:26px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:15px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#6f6b8a; padding-bottom:6px;">WHAT HAPPENS NOW</div>- <div style="font-size:14px; line-height:22px; color:#494566;">- Ship updates whenever you like — each new version goes through the same quick review.- Want people to find it in the meantime?- <a href="{{ share_url }}" style="color:#6d28d9; font-weight:700; text-decoration:underline; white-space:nowrap;">Copy the link</a>- </div>- </td></tr>- </table>- </td></tr>- {%- endif %}- {%- else %}- <tr><td class="gutter" style="padding:24px 48px 0;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f7f6fc" style="border-radius:10px;">- <tr><td style="padding:15px 18px;">- <div style="font-size:11px; font-weight:800; letter-spacing:2px; color:#6f6b8a; padding-bottom:6px;">WHAT HAPPENS NEXT</div>- <div style="font-size:14px; line-height:22px; color:#494566;">- {%- if changes or has_note %}- Resubmitting sends it back to {{ reviewer_name }}, who already has your context.- {%- endif %}- {%- if resubmission %}- This is round {{ version | default(1) }} — most agents that make it do so after a couple of passes, so this is the normal shape of it.- {%- else %}- Most agents need at least one round of changes.- {%- endif %}- {% if changes or has_note %} Reply to this email if anything is unclear and it goes straight to the reviewer.{% endif %}- </div>- </td></tr>- </table>- </td></tr>- {%- endif %}-- <tr><td align="center" class="gutter" style="padding:26px 48px 30px;">- <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">- <tr><td height="1" bgcolor="#eeecf5" style="font-size:0; line-height:0;"> </td></tr>- <tr><td align="center" style="padding-top:14px; font-size:12px; line-height:19px; color:#8a86a3;">- You get this because you submitted an agent to the AutoGPT Store.- <div style="padding-top:4px;"><a href="{{ urls.settings }}" style="color:#6d28d9; text-decoration:underline;">Notification settings</a></div>- </td></tr>- </table>- </td></tr>-- </table>- </td></tr>+{{ ui.masthead() }}+{{ ui.hero_otto() }}+{{ ui.sheet_open() }}+{% call ui.eyebrow(tone='confirmed' if approved else 'needs_you') %}MARKETPLACE REVIEW · VERSION {{ version | default(1) }} · {{ 'APPROVED' if approved else 'CHANGES NEEDED' }}{% endcall %}+{% call ui.headline() %}{{ agent_name }} {{ 'is live in the Marketplace' if approved else 'needs one more pass' }}{% endcall %}+{% call ui.para() %}Hi {{ first_name | default('there', true) }}, your workflow {{ 'passed review' if approved else 'needs changes before it can go live' }}. {{ preheader }}{% endcall %}+{% call ui.para() %}{{ reviewer_name }} {{ 'approved' if approved else 'reviewed' }} version {{ version | default(1) }} on {{ reviewed_at_label }}.{% endcall %}+{% if not approved and changes %}+{% call ui.note_card((changes | length) ~ (' thing to change' if changes | length == 1 else ' things to change'), tone='amber') %}+{% for c in changes %}<div style="{{ 'padding-top:10px;' if not loop.first }}">{{ loop.index }}. {{ c }}</div>{% endfor %}+{% if closing_note %}<div style="padding-top:12px; margin-top:12px; border-top:1px solid #F2DCB0;">{{ closing_note }}</div>{% endif %}+{% endcall %}+{% elif not approved %}+{{ ui.note_card('What needs to change', comments if has_note else 'The reviewer did not leave a written note. Reply to this email to ask for details.', tone='amber') }}+{% elif has_note %}+{{ ui.note_card('Note from ' ~ reviewer_name, comments) }}+{% endif %}+{{ ui.cta('View in the Marketplace' if approved else 'Edit and resubmit', store_url if approved else resubmit_url) }}+{% if approved and share_url %}+{{ ui.also_panel('What happens now', [('Share your workflow.', 'New versions go through review.', 'Open the sharing link', share_url)]) }}+{% elif not approved %}+{% call ui.para(size=14, lh=21) %}Your submission is saved. Make the requested changes, then submit it for review again. Reply to this email if anything is unclear.{% endcall %}+{% endif %}+{{ ui.close_row('You get this because you submitted a workflow to the AutoGPT Marketplace.', 'Notification settings', urls.settings) }}+{{ ui.sheet_close() }}{{ ui.page_close() }}-{{ ui.legal_footer('This review update is for the AutoGPT account ' ~ user_email ~ '.', urls.unsubscribe) }}--</td></tr>-</table>-</body>-</html>+{{ ui.product_footer('This is a product notification for the AutoGPT account for ' ~ user_email ~ '.', urls.unsubscribe) }}+</td></tr></table>+</body></html>diff --git a/autogpt_platform/backend/backend/notifications/templates/verdict.subject.j2 b/autogpt_platform/backend/backend/notifications/templates/verdict.subject.j2index 6f7cfb8756..e05d1487ec 100644--- a/autogpt_platform/backend/backend/notifications/templates/verdict.subject.j2+++ b/autogpt_platform/backend/backend/notifications/templates/verdict.subject.j2@@ -1,16 +1,9 @@-{%- import "_ui.j2" as ui -%}-{#- Two lines: subject, then preheader.- The preheader carries the first slice of the reviewer's note, because on a- changes verdict that is the single thing the creator wants to see. -#}-{%- set approved = (outcome == 'approved') -%}-{%- set has_note = comments and comments | trim | length > 0 -%}-{%- set note = (comments | trim | replace('\n', ' ')) if has_note else '' -%}-{%- set note_short = ui.trunc(note, 110) -%}+{%- import "_email_ui.j2" as ui -%}{%- set name = ui.trunc(agent_name, 44) -%}-{%- if approved -%}-{{ name }} is live in the AutoGPT Store-{% if has_note %}{{ reviewer_name }} says: {{ note_short }}{% else %}Version {{ version | default(1) }} passed review — it is discoverable and installable now.{% endif %}+{%- if outcome == 'approved' -%}+{{ name }} is live in the AutoGPT Marketplace+Anyone browsing the Marketplace can now find it, install it, and run it.{%- else -%}{{ name }} needs one more pass before it goes live-{% if changes %}{{ ui.trunc(changes[0], 110) }}{% elif has_note %}{{ note_short }}{% else %}No written feedback was left — reply to this email and it goes straight to the reviewer.{% endif %}+Your submission is saved and you can resubmit as soon as it is fixed.{%- endif -%}diff --git a/autogpt_platform/backend/backend/notifications/templates/verdict.txt.j2 b/autogpt_platform/backend/backend/notifications/templates/verdict.txt.j2index c872291961..50179dbe64 100644--- a/autogpt_platform/backend/backend/notifications/templates/verdict.txt.j2+++ b/autogpt_platform/backend/backend/notifications/templates/verdict.txt.j2@@ -1,14 +1,16 @@{#- Plain-text part of the Verdict, built from the same context as the HTML. -#}{%- set approved = (outcome == 'approved') -%}{%- set has_note = comments and comments | trim | length > 0 -%}-STORE REVIEW - VERSION {{ version | default(1) }}{% if not approved %} - CHANGES NEEDED{% endif %}+MARKETPLACE REVIEW · VERSION {{ version | default(1) }}{% if not approved %} · CHANGES NEEDED{% endif %}{{ subject }}+Hi {{ first_name | default('there', true) }}, your workflow {{ 'passed review' if approved else 'needs changes before it can go live' }}. {{ preheader }}+{% if approved %}{{ reviewer_name }} approved version {{ version | default(1) }} on {{ reviewed_at_label }}.-{{ agent_name }} is live in the AutoGPT Store: anyone can find it, install it+{{ agent_name }} is live in the AutoGPT Marketplace: anyone can find it, install itand run it.{% else %}{{ reviewer_name }} reviewed version {{ version | default(1) }} on {{ reviewed_at_label }} and found@@ -28,7 +30,7 @@ submission is saved and you can resubmit as soon as it is fixed.{% elif not approved %}WHAT NEEDS TO CHANGE-{{ comments if has_note else 'The reviewer did not leave a written note. Reply to this email and it goes straight to them.' }}+{{ comments if has_note else 'The reviewer did not leave a written note. Reply to this email to ask for details.' }}{% elif has_note %}NOTE FROM {{ reviewer_name | upper }}@@ -36,17 +38,22 @@ NOTE FROM {{ reviewer_name | upper }}{% endif %}{% if approved %}-View it in the Store: {{ store_url }}+View in the Marketplace: {{ store_url }}{% if share_url %}-Share it: {{ share_url }}+New versions go through review.+Open the sharing link: {{ share_url }}{% endif %}{% else %}-Update and resubmit: {{ resubmit_url }}+Edit and resubmit: {{ resubmit_url }}+Your submission is saved. Make the requested changes, then submit it for review again. Reply to this email if anything is unclear.{% endif %}--+You get this because you submitted a workflow to the AutoGPT Marketplace.Notification settings: {{ urls.settings }}-This review update is for the AutoGPT account {{ user_email }}.+This is a product notification for the AutoGPT account for {{ user_email }}.+AutoGPT: https://agpt.coAutoGPT, 3rd Floor, 1 Ashley Road, Altrincham, WA14 2DT, UKUnsubscribe: {{ urls.unsubscribe }}+Discord: {{ urls.discord }}diff --git a/autogpt_platform/backend/backend/util/settings.py b/autogpt_platform/backend/backend/util/settings.pyindex adab5e13a4..f8e2aab723 100644--- a/autogpt_platform/backend/backend/util/settings.py+++ b/autogpt_platform/backend/backend/util/settings.py@@ -625,6 +625,14 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):default="AutoGPT <[email protected]>",description="Sender for the Briefing, Alert and Verdict families",)+ billing_reply_to_email: str = Field(+ default="[email protected]",+ description="Shared inbox for replies to billing and account service messages",+ )+ product_reply_to_email: str = Field(+ default="[email protected]",+ description="Reply-to address for Briefing, Alert and Verdict notifications",+ )ops_sender_email: str = Field(default="AutoGPT Platform <[email protected]>",description="Sender for internal ops mail to the refunds team",diff --git a/docs/engineering/email-design/alert-auth-before-after.jpg b/docs/engineering/email-design/alert-auth-before-after.jpgnew file mode 100644index 0000000000..f015389c2bBinary files /dev/null and b/docs/engineering/email-design/alert-auth-before-after.jpg differdiff --git a/docs/engineering/email-design/welcome-before-after.jpg b/docs/engineering/email-design/welcome-before-after.jpgnew file mode 100644index 0000000000..68145164caBinary files /dev/null and b/docs/engineering/email-design/welcome-before-after.jpg differdiff --git a/docs/engineering/transactional-email-design.md b/docs/engineering/transactional-email-design.mdnew file mode 100644index 0000000000..c1571ecdd5--- /dev/null+++ b/docs/engineering/transactional-email-design.md@@ -0,0 +1,104 @@+# Transactional email design++All platform-generated Postmark emails use the Edition 1 email design system+(2 October 2026). The renderer builds HTML and plain text from the same event+payload; Postmark receives those bodies rather than a hosted template ID.++## Inventory++| Family | Variants | Design and delivery |+| --- | --- | --- |+| Lifecycle | Welcome, payment failed, final notice, cancellation confirmed, cancellation reversed, ended (payment/cancellation) | Billing sender; contact reply-to; service footer; no unsubscribe |+| Trial | Started, ending, canceled, resumed, converted, payment failed, ended | Same billing rules; neutral Otto; one plan/payment action |+| Briefing | Daily, weekly, monthly; quiet/standard; attention/no attention | Product sender; hello reply-to; signed cadence links; one-click unsubscribe |+| Alert | Each cause, including coalesced alerts | Amber needs-you strip and primary attention card; secondary actions are text links |+| Verdict | Approved; changes requested with/without notes | State eyebrow; reviewer feedback preserved and escaped; one marketplace action |+| Ops | Refund request, refund processed | Internal amount band and compact Otto; admin action; no unsubscribe |+| Auth | Verify email, reset password, confirm new email | Compact layout without hero; action button and complete fallback URL; HTML and text; original subjects and origin validation |++Organization invitations have no email sender yet. SMTP/Gmail workflow blocks+send user-authored content and are not platform transactional notices. The+onboarding/changelog files remain marketing references; updating them does not+publish content or settings to MailerLite.++## Design contract++`backend/notifications/templates/_email_ui.j2` is the shared kit. It defines the+560px sheet, 48px desktop/22px phone gutters, Geist with system fallbacks, purple+`#6144DF` actions, ink `#171925`, white sheet and lavender paper. Facts stack on+phones. Each family owns its HTML, subject/preheader, and text templates. The+preheader appears in the lede; supplied user names and feedback stay escaped,+and customer-authored punctuation is preserved.++One primary button is the default. Cancellation confirmation uses a billing+text link. A Briefing without an attention item uses highlight/run-history text+links; its cadence controls are signed for that recipient. Only the welcome is+signed by a person. Its Expert CTA is selected using the recipient's+`HIRE_EXPERTS` flag; older queued messages and failed flag lookups default to+the workflow action. Secondary Marketplace copy follows the same selection.++Billing has no unsubscribe promise it cannot honor. Product emails match the+footer unsubscribe URL to both one-click headers. Auth and internal ops have no+unsubscribe. All include the registered address; auth has only the Discord+footer link and ops has no footer links.++## Images and configuration++`EMAIL_ASSET_BASE_URL` defaults to `https://platform.agpt.co/email`, containing+`logo-light.png` (790x356 served at 100x45). Otto uses the same URL origin plus+`/autogpt-characters/v1.1/otto/neutral/256.png`, served at 160x160 or 80x80 for ops.+Both files ship in the frontend public assets. A custom asset host must serve+both paths publicly over HTTPS without cookies or authentication.++Images use hosted PNG URLs, explicit dimensions, and descriptive alt text.+There are no data URIs or inline SVGs. The same text, facts and action links+remain when an email client blocks images. Historical image files are retained+because already-delivered messages can still reference their URLs; new+transactional templates do not use the retired art.++Deployment overrides still control `POSTMARK_SENDER_EMAIL`,+`BILLING_SENDER_EMAIL`, `PRODUCT_SENDER_EMAIL`, `OPS_SENDER_EMAIL`, and+`POSTMARK_TRANSACTIONAL_STREAM`. This migration preserves those From values.+`BILLING_REPLY_TO_EMAIL` defaults to `[email protected]` and+`PRODUCT_REPLY_TO_EMAIL` to `[email protected]`. Configure a verified named auth+sender in deployment; the repository must not invent or activate a sender.++The auth RPC remains compatible across old and new API and notification-service+versions during deployment and rollback. The client sends named JSON fields;+an older service ignores the new `text_body` field and still sends the HTML,+while the new service accepts requests without that field. Plain text is+included when both components use the new code. This change does not require+a particular service deployment order.++## Validation++Local validation: 258 focused tests pass. The browser audit covers 31 scenarios+at two widths (62 renders), including images blocked, with 1,548 text contrast+checks and no failures. Public production logo and Otto endpoints returned+HTTP 200 with PNG content without authentication.++The notification design fixtures cover each lifecycle/trial branch, welcome+feature cohorts, Briefing cadences/attention, coalesced alerts, verdicts, and+refunds. Tests check frame/tokens, safe images, CTA exceptions, size, footers,+link parity and escaped feedback. Auth tests check all three actions, URL+escaping, origin restrictions, and plain-text delivery. Transport tests inspect+the actual Postmark request fields with the network client mocked.++Browser rendering checks at 640px and 390px test image-on/image-off layout,+horizontal overflow and WCAG AA contrast against the effective background.+Browser evidence is not an actual Gmail, Apple Mail or Outlook delivery test.+Before release, send staging samples to authorized test inboxes and inspect+light/dark mode, images off, plain text, button and fallback links, and signed+unsubscribe/cadence controls. Also exercise destinations signed out, with the+feature disabled, and after the relevant task is complete. No email was sent,+production configuration changed, or deployment performed by this PR.++## Review previews++These screenshots use synthetic data and the supplied production logo/Otto+assets. The before column is the original `dev` template; after is this shared+kit. Each comparison includes desktop (640px) and phone (390px) renderings.++++