Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mavera.io/llms.txt

Use this file to discover all available pages before exploring further.

Scenario

Marketing creates content in a vacuum, disconnected from what sales is actually selling. This job pulls your current pipeline by stage and industry, identifies dominant segments, and uses Mavera’s generation engine to produce stage-specific nurture content dynamically tied to your real pipeline. When your pipeline shifts, your content shifts with it.

Architecture

Code

import os, requests
from collections import Counter

SF   = os.environ["SALESFORCE_INSTANCE"]
SF_T = os.environ["SALESFORCE_ACCESS_TOKEN"]
MV_K = os.environ["MAVERA_API_KEY"]
SF_H = {"Authorization": f"Bearer {SF_T}"}
MV_H = {"Authorization": f"Bearer {MV_K}", "Content-Type": "application/json"}

opps = requests.get(
    f"https://{SF}/services/data/v66.0/query", headers=SF_H,
    params={"q": "SELECT StageName, Industry, Amount FROM Opportunity WHERE IsClosed = false ORDER BY Amount DESC LIMIT 100"},
).json()["records"]

seg_counts = Counter((o.get("StageName", "Unknown"), o.get("Industry", "Unknown")) for o in opps)
top_segments = seg_counts.most_common(5)

for (stage, industry), count in top_segments:
    seg_value = sum(o.get("Amount", 0) for o in opps if o.get("StageName") == stage and o.get("Industry") == industry)
    context = f"{count} open deals in '{stage}' stage, {industry} industry. Pipeline value: ${seg_value:,.0f}."

    gen = requests.post(
        "https://app.mavera.io/api/v1/generations", headers=MV_H,
        json={
            "input_data": context,
            "prompt": (
                f"Generate a nurture email for prospects in the '{stage}' stage, "
                f"{industry} industry. Address common concerns at this stage, "
                f"provide social proof, include a clear next-step CTA."
            ),
        },
    ).json()

    print(f"\n{'='*50}")
    print(f"Stage: {stage} | Industry: {industry} | Deals: {count}")
    print(f"{'='*50}")
    print(gen.get("output", ""))

Example Output

==================================================
Stage: Qualification | Industry: Technology | Deals: 12
==================================================
Subject: How [TechCorp] cut evaluation time by 3 weeks

Hi {{Name}},

I noticed your team is evaluating solutions. We recently helped TechCorp,
a similar-sized engineering org, go from first call to POC results in 10 days.

What made the difference:
- Pre-built integrations with their existing stack
- Dedicated SE for the entire eval period
- ROI calculator access before any contracts

Would a 20-minute walkthrough be useful?

==================================================
Stage: Negotiation | Industry: Financial Services | Deals: 8
==================================================
Subject: Your security review — we've done this before

Hi {{Name}},

Security reviews can slow things down in financial services. We've completed
InfoSec reviews with 15+ banks this year — happy to share our SOC 2 Type II,
pen test results, and data residency docs upfront.

Want me to send the security packet today?
Schedule weekly via cron. When your pipeline shifts toward a new industry or stage, your content library automatically adapts.

Salesforce Overview

Back to all 8 Salesforce jobs

Competitive Displacement Tracker

Next: AI-generated battle cards from competitor data