Accessing transaction data in a Shopify email notification

Recently I needed to add a line to the Shopify Order Confirmation email that included the last 4 digits of the credit card used. This was more difficult than it needed to be, so I’m writing this post in hopes it’ll rise to the top in Google and help others trying to do the same thing.


You need to access the transaction object through a collection of transactions, like so:

{% for transaction in transactions %}
{{ transaction.payment_details.credit_card_number }}
{% endfor %}

This was stupidly difficult to track down. First, I went to the email variables article that’s referenced when you’re editing a notification. There, it states:

Notifications have access to every transaction property. Please see our Transaction API documentation here for a full list of the properties.

So I checked out that article, which didn’t help at all. Dead end.

After a few more searches, I finally found this thread in the forums that addressed my problem exactly. Reading through some of the comments, I thought I had hit another dead end, until I read the last comment in the thread, which pointed me to the thread that answered my question. Thanks to Mikkel Jakobsen for tracking down the answer!

Why ConvertKit Wasn’t The Right Choice For Me

A few months ago, I wrote a post on switching from MailChimp to ConvertKit. At the time, I knew I needed to get off MailChimp, but didn’t know exactly what features I needed to be looking for. After using ConvertKit for five months, I’ve decided that I need to find something else. ConvertKit is great (and works really well for a lot of people like Pat Flynn), but I need a little more than what it has to offer. Namely:

  • Event tracking. It’s not enough to just tag a subscriber with some info (like ‘customer’ or ‘free-guide-download’). I want to know WHEN that tag was applied, when that subscriber converted, etc. Knowing when would help me craft better email sequences and create a more personalized experience for a subscriber.
  • A robust API. I’m starting to use a lot of different services to manage Stitch People, and am building custom solutions to integrate them. For example, we use Zendesk for our support emails. When someone writes in, we have an app that displays customer information about that person from our Shopify store. I wanted the same kind of functionality for people who purchased our products on Amazon, so I built my own app for that. The next app I build will be for pulling in data from our email marketing tool with all that event data I already mentioned. When did they subscribe? How many emails have they opened? How engaged are they in the brand? All this information will help me provide better customer service, but I can’t get that data without a good API. The ConvertKit API isn’t robust enough to handle what I need.
  • Subscriber meta fields. I need to be able to store more information about a subscriber than just name and email. I’d like to eventually build out my own abandoned email recovery tool and email sequence, and need to be able to save things like cart recovery URL for a subscriber.
  • Lead scoring. This was a feature I enjoyed in MailChimp, but didn’t think I needed. Turns out I really do need it. We have a Facebook group full of really great, engaged customers. MailChimp’s engagement scores helped me handpick that group, but now that I don’t have anything that shows me my most engaged subscribers, I don’t know who to invite into the group to keep things fresh.
  • Subscriber tracking. I’d love to close the loop on interactions subscribers have with my site. I’m segmenting people for Facebook Custom Audiences based on how they interact with my site, and I’d like to do that same kind of segmentation for my email list. For example, with the purchase of the DIY Stitch People book comes access to additional patterns available only online. I want to build a series of emails that can account for whether or not a subscriber has visited that URL yet. And what about customers who have already purchased one product, but are back on the website looking at other products? I’d like to proactively reach out to them based on what they were looking at.

Right now, it looks like Drip is going to be my best option. But before I commit to moving all my subscribers over, I’m going to do the free trial and see how things go. I’m also concerned that if I leave ConvertKit, all the links in emails I’ve previously sent won’t work anymore (like what happened when I left MailChimp), but that may be worth the benefits I’d be getting from Drip. More to come as I try out Drip and make a decision.

Stitch People on the Unofficial Shopify Podcast

Lizzy and I had a really cool opportunity a few weeks ago to be interviewed on Kurt Elster’s Unofficial Shopify Podcast. It was a ton of fun, and Kurt was a great host for us. We walked in not knowing where the conversation would take us, and I think we were all a bit surprised by what we ended of focusing on: building a tribe around Stitch People. Using Seth Godin’s ‘Tribes’ as a blueprint, we’ve worked hard at making our marketing personal and building a dedicated fan base around the Stitch People brand. That has led to an incredible Stitch People Community group on Facebook with over 650 members, incredible interactions between fans of Stitch People, and great one-on-one engagement between fans and Lizzy.
You can listen to the full episode below, or check it out at

Podcasts in Google Music

UPDATE (2/3/2016) – In October of 2015, Google announced that they’d be adding Podcasts to Google Play Music. Great news! It looks as if they’re starting to slowly roll out this functionality–some users are reporting that they’re seeing the new Podcasts section in their app. I don’t see anything in my app yet, but when I do, I’ll be sure to write a review here.

UPDATE (4/15/2015)Pocket Casts is my new favorite podcast player for Android.

UPDATE (8/26/2014) – Google Music still hasn’t added podcast support, and at this point I doubt they ever will. I’ve started using Podcast Addict to listen to podcasts exclusively on my Nexus 5, so I don’t need to sync podcasts and their playback status with another device or library. It even has Chromecast support.

UPDATE (8/9/2013) – Now that Google Music has become a subscription service, I’ve moved over to it exclusively for my music. So far, I’ve been very happy with the service–especially the seamless integration with the Chromecast at home. However, they still haven’t added native podcast support.

You can get the Chromecast at Amazon for $35. I highly recommend it.

Chromecast at Amazon

UPDATE (9/4/2012) – Still no native podcast support in Google Music. This continues to be the best way for me to get podcasts into Google Music.

A few people have said that they don’t have the check box for including podcasts. To make sure this check box appears, you need to tell Google Music that you keep your music in iTunes (look for “Location of my music collection” on the Advanced tab). Once you’ve done that, you’ll see the option to upload podcasts.

ORIGINAL POST (1/4/2012):

I still think it’s only a matter of time before Google Music adds podcast subscriptions natively. But until that happens, I’ve found a solution to get podcasts into your Google Music account that uses iTunes as the podcast manager.

With Google Music, you can download the Music Manager, a small application that acts as the link between your computer and Google Music. With Music Manager, you can upload your current library (you specify the location) or download the music you’ve purchased through Google (someday I expect the ability to also download music you’ve uploaded). But iTunes podcasts aren’t included in that library upload by default.

Under the Advanced tab in Music Manager is a checkbox to ‘Include podcasts in uploads’. Check that box and now you’ve got your podcasts available in the cloud, accessible from the web and the Google Music app on your Android phone. If you leave both iTunes and Music Manager running in the background, new podcasts will be downloaded and uploaded without any supervision.

Also, make sure iTunes is selected as the location of your music collection:

google music podcasts

Here are a few of my favorite podcasts:

Using Markdown for Email Templates in Rails

I’ve been working on a Rails freelance project that has a lot of email templates. For the last year, I’ve had two versions of each template–an HTML template and a text template. For a welcome email, I had both welcome.html.erb and welcome.text.erb. The worst part about this setup is that when you need to make a change to the email, you need to change two files. This isn’t very DRY, so I finally went in search of a better way to do this.
I found several StackOverflow questions that helped me get to my current solution. If you’re interested in the context, here they are:

Markerb gem

Using Markdown seemed like a great solution, so I started digging into the Markerb gem. This gem, combined with a parser (I’m using the recommended Redcarpet), allows you to write just one email template–in my case, welcome.markerb. Using standard Markdown format, I now only have to manage a single template, which is then parsed into both the text part and HTML part when the email gets sent.

Once you add Markerb to your Gemfile and run the bundle command, all you need to change is the extension on your template file and then reformat your templates to use Markdown. Nothing changes in your ActionMailer. When Rails goes looking for the template, Markerb takes over, parses the file, and spits out the text and HTML parts that get sent out.