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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
腾讯CDC
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
有赞技术团队
有赞技术团队
美团技术团队
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
博客园_首页
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
Docker
博客园 - Franky
Jina AI
Jina AI

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.