Tags: mail

58

sparkline

Saturday, March 9th, 2019

Updating email addresses with Mailchimp’s API

I’ve been using Mailchimp for years now to send out a weekly newsletter from The Session. But I never visit the Mailchimp website. Instead, I use the API to create a campaign each week, and then send it out. I also use the API whenever a member of The Session updates their email preferences (or changes their details).

I got an email from Mailchimp that their old API was being deprecated and I’d need to update to their more recent one. The code I was using had been happily running for about seven years, but now I’d have to change it.

Luckily, Drew has written a really handy Mailchimp API wrapper for PHP, the language that The Session’s codebase is in. Thanks, Drew! I downloaded that wrapper and updated my code accordingly.

Everything went pretty smoothly. I was able to create campaigns, send campaigns, add new subscribers, and delete subscribers. But I ran into an issue when I wanted to update someone’s email address (on The Session, you can edit your details at any time, including your email address).

Here’s the set up:

use \DrewM\MailChimp\MailChimp;
$MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
$list_id = 'b1234346';
$subscriber_hash = $MailChimp -> subscriberHash('currentemail@example.com');
$endpoint = 'lists/'.$listID.'/members/'.$subscriber_hash;

Now to update details, according to the API, I can use the patch method on that endpoint:

$MailChimp -> patch($endpoint, [
    'email_address' => 'newemail@example.com'
]);

But that doesn’t work. Mailchimp effectively treats email addresses as unique IDs for subscribers. So the only way to change someone’s email address appears to be to delete them, and then subscribe them fresh with the new email address:

$MailChimp -> delete($endpoint);
$newendpoint = 'lists/'.$listID.'/members';
$MailChimp -> post($newendpoint, [
    'email_address' => 'newemail@example.com',
    'status' => 'subscribed'
]);

That’s somewhat annoying, as the previous version of the API allowed email addresses to be updated, but this workaround isn’t too arduous.

Anyway, I figured it share this just in case it was useful for anyone else migrating to the newer API.

Update: Belay that. Turns out that you can update email addresses, but you have to be sure to include the status value:

$MailChimp -> patch($endpoint, [
    'email_address' => 'newemail@example.com',
    'status' => 'subscribed'
]);

Okay, that’s a lot more straightforward. Ignore everything I said.

Saturday, February 9th, 2019

Oh God, It’s Raining Newsletters — by Craig Mod

After musing on newsletters, Craig shares how he’s feeling about Instagram and its ilk:

Instagram will only get more complex, less knowable, more algorithmic, more engagement-hungry in 2019.

I’ve found this cycle has fomented another emotion beyond distrust, one I’ve felt most acutely in 2018: Disdain? (Feels too loaded.) Disappointment? (Too moralistic.) Wariness? (Yes!) Yes — wariness over the way social networks and the publishing platforms they provide shift and shimmy beneath our feet, how the algorithms now show posts of X quality first, or then Y quality first, or how, for example, Instagram seems to randomly show you the first image of a multi-image sequence or, no wait, the second.8

I try to be deliberate, and social networks seem more and more to say: You don’t know what you want, but we do. Which, to someone who, you know, gives a shit, is pretty dang insulting.

Wariness is insidious because it breeds weariness. A person can get tired just opening an app these days. Unpredictable is the last thing a publishing platform should be but is exactly what these social networks become. Which can make them great marketing tools, but perhaps less-than-ideal for publishing.

Sunday, January 27th, 2019

No More Google

A list of alternatives to Google’s products.

Saturday, December 29th, 2018

A New Mailing List, Goodbye Instagram?, Future Book Hello Again — Roden Explorers Archive

Craig’s slow walk away from Instagram:

I want to have a place very far apart from that, where I can post photos on my own terms. Not have an algorithm decide which of my posts is best (have you noticed Instagram making the second photo in series appear first in the carousel?). And I don’t want to be rewarded for being anodyne, which is what these general algorithms seem to optimize for: things that are easily digestible, firmly on the scale of “fine, just fine.” It becomes a self-fulfilling prophecy, as the more boring stuff we shove into our eyeballs, the more boring our taste becomes.

Saturday, December 22nd, 2018

The ‘Future Book’ Is Here, but It’s Not What We Expected | WIRED

Craig writes about reading and publishing, from the memex and the dynabook to the Kindle, the iPhone, and the iPad, all the way back around to plain ol’ email and good old-fashioned physical books.

We were looking for the Future Book in the wrong place. It’s not the form, necessarily, that needed to evolve—I think we can agree that, in an age of infinite distraction, one of the strongest assets of a “book” as a book is its singular, sustained, distraction-free, blissfully immutable voice. Instead, technology changed everything that enables a book, fomenting a quiet revolution. Funding, printing, fulfillment, community-building—everything leading up to and supporting a book has shifted meaningfully, even if the containers haven’t. Perhaps the form and interactivity of what we consider a “standard book” will change in the future, as screens become as cheap and durable as paper. But the books made today, held in our hands, digital or print, are Future Books, unfuturistic and inert may they seem.

Friday, August 3rd, 2018

Post Haste

Look, it’s Friday—were you really going to get any work done today anyway?

Saturday, February 24th, 2018

On AMP for Email by Jason Rodriguez

Philosophically, I’m completely against Google’s AMP project and AMP for Email, too. I will always side with the open web and the standards that power it, and AMP is actively working against both. I’m all-in on a faster web for everyone, but I just can’t get behind Google’s self-serving method for providing that faster web.

Tuesday, January 30th, 2018

Famous first words

Thursday, January 25th, 2018

Buttondown

This looks like an interesting alternative to TinyLetter for writing and sending email newsletters, like all the cool kids are doing.

Tuesday, January 16th, 2018

Secure Contexts Everywhere | Mozilla Security Blog

I’m all in favour of HTTPS everywhere, but this kind of strong-arming just feels like blackmail to me.

All new CSS properties won’t work without HTTPS‽ Come on!

I thought Mozilla was better than this.

Wednesday, July 19th, 2017

Writing Hacks: The Adafruit Guide to Being Excellent to Each Other in Emails « Adafruit Industries – Makers, hackers, artists, designers and engineers!

Language is a technology. It’s a particularly strange one that’s made of squiggles and sounds and maps of meaning, but like any other technology, it’s hackable.

Good advice on reducing unintended stress via email.

Negativity bias is a tendency for negatives to have a greater effect than positives on our emotional state.

For email this can have radical effects: positive emails seem neutral, neutral emails seem negative, and even slightly negative emails can lead to actual, measurable pain.

Even with the best of intentions we can come off distant — or just plain mean.

Sunday, March 19th, 2017

Better Web Typography for a Better Web

A free ten part email course on web typography for designers and developers. The end results will be gathered together into a book.

Thursday, February 9th, 2017

The History of the Web - The best stories from the web’s history

What a great project! A newsletter that focuses on stories from the web’s history, each one adding to an ongoing timeline (a bit like John’s hypertext history).

Wednesday, August 10th, 2016

Formspree

There’s this really common use-case I’ve seen at Codebar and Homebrew Website Club, where someone is making a static site, but they just want a contact form that sends data via email. This looks like a handy third-party service to do just that. No registration required: it’s all done via the value of the action attribute in the opening form tag:

action="https://formspree.io/your@email.com"

Sunday, August 7th, 2016

The History of Email - Eager Blog

The ancestors of the Internet were kind enough to give us a communication standard which is free, transparent, and standardized. It would be a shame to see the tech communication landscape move further and further into the world of locked gardens and proprietary schemas.

Wednesday, January 7th, 2015

Postcards from a Supply Chain

Dan has started writing up what he did on his Summer hols …on a container ship travelling to China.

It is, of course, in the form of an email newsletter because that’s what all the cool kids are doing these days.

Saturday, December 20th, 2014

Send emails to any domain, receive messages at your domain@questo.email

This is a nifty little service: if your site has a webmention endpoint, people can comment on your articles by sending an email.

That means you can comment on any post on my site by sending an email to adactio.com@questo.email (in the email, include the URL of the post you’re commenting on).

Tuesday, November 11th, 2014

Mailbox and Facebook App Links by Jon Smajda

When your email client pre-fetches capability URLs, you’re going to have a bad time.

Wednesday, November 6th, 2013

Pattern Library | MailChimp

The markup for the patterns that Mailchimp use on their products. I love getting a glimpse of how companies handle this kind of stuff internally.

Saturday, May 18th, 2013

Laurent Eschenauer: What’s next Google? Dropping SMTP support?

The litany of open standards that Google has been abandoning: RSS, XMPP, WebDav…