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

推荐订阅源

F
Fortinet All Blogs
罗磊的独立博客
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
博客园 - 聂微东
博客园_首页
爱范儿
爱范儿
量子位
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Martin Fowler
Martin Fowler
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog
Vercel News
Vercel News
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
Engineering at Meta
Engineering at Meta

Buttondown's blog

Email could have been X.400 times better The physicists who convinced Fermilab to send Brazil's emails Slack webhooks Better in-app previews Analytics 3.0 Subscriber ID variables Comments! Send latest premium action Automation filtering Free API subscribers Surveys in automations Reply to replies Labels for RSS feeds How Jeremy Singer-Vine curates curious datasets for readers 2023 (and what's next) Email vs web content Sort by engagement Better gift subscriptions How Andy Dehnart built a career reviewing television New email template Email-based automations Opt-in reply tracking Automatic alt text More social network integrations Sort by metadata Overlarge image warnings Automation tag actions Pause emails mid-flight Search tags and automations Gift via automations
Email as primary key
Justin Duke · 2023-05-19 · via Buttondown's blog

(NERD ALERT: If you don't use the API, this post is not for you.)

If you do use the API, you might have run into a small frustration which is this:

You're trying to sync some existing corpus of subscribers (say, your userbase) with Buttondown's list. So every time someone registers an account, they become a Buttondown subscriber.

This is easy: you just make a POST request to /v1/subscribers with their email address and you're done.

But what if you want to then change something about them? Let's say you want to add a tag to them (to reflect the fact that they're a churn risk) or you want to delete them (because they've deleted their account.)

You can't do that, because you don't know their subscriber ID. You'd have to either store that subscriber ID in your database (not the end of the world, but kind of annoying) or search for them with /v1/subscribers?email=foo@bar.com and then grab their ID (again, not the end of the world, but kind of annoying.)

Now there is a better way!

Just use their email address as a PK. You can call, e.g. DELETE /v1/subscribers/justin@buttondown.email and it will Just Work.

This doesn't let you do anything you couldn't already do, but it should make integration, like, 10% easier. And that adds up.

Check out the subscribers API reference for more details.