惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Commits to openclaw:main
Recent Commits to openclaw:main
GbyAI
GbyAI
Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
博客园_首页
B
Blog RSS Feed
Recorded Future
Recorded Future
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
D
DataBreaches.Net
IT之家
IT之家
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
T
The Blog of Author Tim Ferriss
B
Blog
The Cloudflare Blog
MyScale Blog
MyScale Blog
雷峰网
雷峰网
U
Unit 42
C
Check Point Blog
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
D
Docker
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
L
LangChain Blog
F
Fortinet All Blogs
腾讯CDC
Martin Fowler
Martin Fowler
I
InfoQ
J
Java Code Geeks
博客园 - Franky
Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Add email signatures with the Nylas Signatures API
Qasim · 2026-06-25 · via DEV Community

Here's a thing that surprises people the first time: an email sent through the API does not carry the signature the user set up in Gmail or Outlook. Provider signatures live in the provider's compose UI, and a programmatic send bypasses that entirely, so a message your app sends goes out with no signature at all unless you add one. The Nylas Signatures API is how you add it: store an HTML signature once, then attach it to a send by ID, and the signature gets appended to the message for you.

This post covers signatures from two angles: the HTTP API your backend calls, and the nylas CLI for creating and testing one from the terminal. I work on the CLI, so the terminal commands below are the ones I reach for when I'm setting a signature up.

Nylas signatures are separate from provider signatures

The first thing to get straight is that these are not the user's existing signature. Nylas doesn't sync the signature configured in Gmail, Outlook, or any other provider, and that provider signature is never applied to mail sent through the API. If a message your app sends needs a sign-off, you create that signature with this API and attach it explicitly; there's no inheriting it from the connected account.

That separation is deliberate, because a programmatic send is a different context from a person typing in their webmail. It does mean the responsibility is yours: a user who connects their mailbox expecting their familiar signature to appear on app-sent mail won't get it automatically. Stored signatures are grant-scoped, living at /v3/grants/{grant_id}/signatures, so each connected account has its own set, and they're HTML, so a branded sign-off with a logo and links works the same as a plain one.

Create a signature

Creating a signature is a POST /v3/grants/{grant_id}/signatures with a name and an HTML body. The name is for you, a label to find it by later; the body is the markup that gets appended to outbound mail. The response returns the signature with its ID, which is what you reference when sending.

curl --request POST \
  --url "https://api.us.nylas.com/v3/grants/<GRANT_ID>/signatures" \
  --header "Authorization: Bearer <NYLAS_API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Work",
    "body": "<p>Best,<br>Sam Rivera<br>Acme Corp</p>"
  }'

The CLI builds the same signature from flags. nylas email signatures create takes a required --name and the HTML as either --body inline or --body-file pointing at a file, which is the better choice for anything with real markup since you keep the HTML in version control instead of escaping it on the command line. Each signatures command also takes an optional grant ID as a positional argument and otherwise uses your active account, so pass it explicitly when you manage signatures across several connected grants:

nylas email signatures create \
  --name "Work" \
  --body-file ./signatures/work.html

Write a signature that renders in email clients

A signature is HTML, but email HTML is its own constrained world, so a few habits keep it rendering across clients. Use inline styles rather than a <style> block, since many clients strip the latter; reference images by an absolute hosted URL rather than relative paths; and lean on simple, table-based structure instead of modern CSS layout, because Outlook in particular ignores a lot of it. Keep it small and conservative and it looks the same in Gmail, Outlook, and Apple Mail.

The signature body is appended to your message as-is, so what you store is what recipients get. Test it by sending yourself a message with the signature attached and checking it in the clients your users actually use, the same way you'd QA any email template. A signature that looks perfect in your browser and breaks in Outlook is the classic email-HTML trap, and storing it on Nylas doesn't change the rules of email rendering.

Attach a signature when you send

A stored signature does nothing until you reference it on a send. You add a signature_id field to a POST /messages/send request, and Nylas appends the signature's HTML to the end of the message body at send time. You don't concatenate anything yourself; you write the body, name the signature, and the recipient sees the body followed by the sign-off.

curl --request POST \
  --url "https://api.us.nylas.com/v3/grants/<GRANT_ID>/messages/send" \
  --header "Authorization: Bearer <NYLAS_API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{
    "to": [{ "email": "client@example.com" }],
    "subject": "Quarterly update",
    "body": "<p>Hi, here is the quarterly update...</p>",
    "signature_id": "<SIGNATURE_ID>"
  }'

One detail worth knowing for replies: the signature is appended after any quoted text in a reply or forward, so it lands at the end of the message, below your new text and the quoted thread, rather than at the very top. The same signature_id works on the Drafts API too: pass it when you create a draft with POST /v3/grants/{grant_id}/drafts, or when you send an existing draft, and it's appended the same way. From the CLI, it's the --signature-id flag on nylas email send and nylas email drafts create, so a signature can ride along on a draft that's reviewed before sending.

There's no server-side notion of a default signature, so your application decides which signature_id to attach on each send. The clean pattern is to store the user's preferred signature ID alongside their grant in your own database and read it at send time, falling back to none when a particular message shouldn't carry one. That keeps the choice in your control rather than implicit, which matters once a user has more than one variant.

Keep variants for different contexts

People don't sign every email the same way, and a grant supports up to 10 signatures so you can keep variants. A common set is "Work" for client mail, "Personal" for everything else, and "Mobile" for a shorter sign-off, each stored separately and chosen per send by its ID. Your application picks which signature_id to attach based on whatever context it's sending in.

That cap of 10 per grant is generous for personal variants but worth keeping in mind if you're tempted to generate a signature per campaign or per template, which would burn through it fast. Signatures are for a user's sign-off, not per-message branding; for message-level variation, the content belongs in the body or a template, and the signature stays the stable identity at the bottom. Treat the 10 slots as a small set of a person's real sign-offs.

Provision signatures per user on connect

In a multi-user app, you create a signature per grant as part of onboarding. When a user connects their mailbox and you get a grant ID, that's the moment to create their signature, either from a default template you fill with their name and title or from input they provide in your UI. From then on, every send from that grant attaches their signature_id.

This scales cleanly because signatures are grant-scoped: each user's sign-off is isolated to their own connected account, and you never cross-contaminate one user's signature onto another's mail. For a product where every user sends from their own mailbox, provisioning the signature at connect time and storing its ID alongside the grant in your database is the pattern, so the right sign-off is always one field away at send time.

Preview a signature before you rely on it

Before wiring a signature into production sends, confirm it renders the way you expect. There's no separate render endpoint for signatures the way there is for templates, so you preview one of two ways. Fetch the signature with a GET and drop its HTML body into a preview pane in your own interface, or send a test message to yourself with the signature_id attached and look at the real result. The second is the more honest check, since it runs the signature through the actual append-and-send path that a real message takes.

Manage your signatures

Signatures support the full CRUD set on /v3/grants/{grant_id}/signatures. A GET lists every signature on the grant, GET /v3/grants/{grant_id}/signatures/{signature_id} fetches one, PUT updates a signature's name or body, and DELETE removes it. The CLI mirrors these with nylas email signatures list, show, update, and delete.

nylas email signatures list
nylas email signatures show <signature-id>

Each signature in the list comes back with its name and ID, so your interface can present them as a picker and let a user choose which sign-off a message uses. Because the list is grant-scoped, a query only ever returns the signatures for the account you asked about, which keeps a multi-user app from leaking one person's variants into another's picker.

Updating is how a sign-off change propagates: edit the signature once, and every future send that references its ID picks up the new HTML, the same decoupling that makes any stored resource worth using over an inline string. When a job title changes or the company rebrands, you update the body in one place rather than hunting through send sites.

Lifecycle: signatures follow the grant

Because signatures are grant-scoped, their lifecycle is tied to the grant. They're created against a specific connected account, they're only usable on sends from that grant, and they're automatically deleted when the parent grant is deleted. You don't have to clean them up separately when a user disconnects; removing the grant takes its signatures with it.

This is the right behavior, since a signature is meaningless without the mailbox it signs for. It also means that if a user re-authenticates by deleting and recreating a grant rather than refreshing it, the signatures don't carry over, and you'd recreate them against the new grant. It's one more reason to re-authenticate an expired grant in place rather than tearing it down, so the stored signatures survive.

Things to keep in mind

A short list of practices keeps signatures predictable.

  • Provider signatures don't apply. Mail sent through the API never inherits the user's Gmail or Outlook signature; attach a stored one explicitly or there's none.
  • Attach by signature_id on the send. A stored signature is inert until a send references it; Nylas appends the HTML for you.
  • It lands after quoted text. On replies and forwards, the signature goes at the end of the message, below the quoted thread.
  • Ten per grant. Keep them to a user's real sign-off variants; don't spend the cap on per-message branding.
  • They die with the grant. Signatures are deleted when the grant is, so re-authenticate in place to keep them.
  • Write email-safe HTML. Inline styles, hosted image URLs, and simple structure render across clients; test in Outlook before trusting it.

Wrapping up

Signatures fill the gap a programmatic send leaves: the provider's own sign-off doesn't come along, so you store an HTML signature on Nylas and attach it by ID. Create one with POST /v3/grants/{grant_id}/signatures or nylas email signatures create, pass its signature_id on a send, and it's appended to the body, after quoted text on replies, with nothing for you to concatenate. Keep a handful of variants per grant, update one to change the sign-off everywhere, and let the grant's lifecycle clean them up.

Where to go next: