Author: Dave

Quick email generator for contests and giveaways using PHP

tl;dr: Quickly generate multiple emails that you can send from your favorite mail client using mailto links and parsing data from various text files. (email addresses, email template, and optional redemption codes)

Background

Recently, I had to contact 50 readers by email for a giveaway that we were running on our site. We’ve run similar sorts of events before and it’s always a tedious experience. It involves something like this:

  1. Get email address from the list of winners.
  2. Write up some sort of email template.
  3. Go through and copy paste template into new email, and then copy and past the email address from list of winners.
  4. Oh, don’t forget to copy and paste the subject line: “Dude, you’ve won FOO! Nice work!”
  5. Oh, this particular giveaway features a unique code for each winner. Make sure you copy and paste that, too!
  6. After all this copy and pasting, send the email.
  7. Repeat this process until you’ve gone through the list of winners. Look at a clock and realize this has taken all afternoon.
  8. “Oh, man,” you think to yourself, “there’s got to be a better way.”

The Better Way

There is! Just download this project to your favorite PHP compatible server (or run an app like MAMP on your machine) and open up the “make_email.php” script.

There are a few required files:

  • emails.txt – This is the list of email addresses you wish to send emails to. Each email address should be on a new line. No commas or funny stuff separating them, please. I didn’t build in any sort of fancy error checking.
  • body.txt – This is the meat and potatoes. This is the message you’re going to want to send over and over and over and over. Sweet! One particularly important note: If there is some sort of unique redemption code or URL that winners will need to go to, you can add in ‘%code%’ (without quotes) to your email. The script will then automatically fill in unique codes when it generates the email (should you choose that options).
  • codes.txt – If you have a whole list of redemption codes or URLs, this is where you put them. Like emails, each code or URL needs to be on a separate line.
    That’s it! You might be wondering how you set the subject line of the email. Right now, it’s a variable at the top of the script. Just change that and you’ll be good to go!

Once you have these text files filled out, run the script, choose whether you’re generating emails with or without redemption codes and then fire away!

You can now click through the list and start firing off emails like you’re your own spambot. Except you’re giving people legitimately cool things. And you’ll still be able to enjoy your afternoon.

If you’re interested in checking it out, you can download the source code on Github.

My top music of 2013

bob_dylan

Bob Dylan

Thanks to things like Rdio and Sonos, I listened to a ridiculous amount of music in 2013. Here are my top bands from the last year. See also 2012 and 2011.

1. Bob Dylan (509 plays)
2. Pretty Lights (488 plays)
3. Daft Punk (382 plays)
4. Dispatch (377 plays)
5. Calexico (372 plays)
6. Frank Turner (366 plays)
7. Macklemore & Ryan Lewis (365 plays)
8. Alt-J (323 plays)
9. Wild Belle (318 plays)
10. The Sounds (268 plays)

Data via Last.FM

Our team at work

Here’s a fun animated GIF of our team at Logitech. Needless to say, we’re all pretty big sports nuts!

Customer_Care_Team

So long, little buddy

Even though you’re still around until July 1st, 2013, I think it’s best to break up with you now. We shared so many fun times since 2005.

I’ll never forget you, Google Reader.

20130611-144717.jpg

What I’m excited about in iOS 7

design_functional_gallery2

Has it really been seven years?

iOS 7: It’s crazy to think it’s been seven years since the first release of iOS / iPhone OS (and the original iPhone) way back in 2007. If you haven’t seen the original video of Steve Jobs’s keynote announcing the iPhone, I highly recommend watching it. It marked the beginning of a new era in how all of us interact with technology.

During today’s iOS 7 keynote, I tried to lay low and not read too much into what people have been saying on Facebook, Twitter, and the comment sections of Engadget and The Verge. The levels of snark are off the scale on days like this and for the most part, it doesn’t positively contribute to the conversation.

What I’m excited about

Everyone has their own likes and dislikes when it comes to their favorite mobile operating system. For the most part, I’m pretty excited about some of the new features announced in iOS 7. I think this release finally tackles a lot of limitations and features that people on other platforms have harped about for years and it’s significantly mitigated the remaining reasons to jailbreak.

One caveat: I write this without having had an opportunity to download the latest beta. That said, I’m really excited about 3 things in particular: namely, the new control panel (a simple swiper from the bottom of your screen brings up a panel offering quick access to common system settings), improved multitasking (Apple’s implementation is allegedly “smart” — apps know when to wake up, update / download data, and go back to sleep. This is huge for apps I commonly use like Feedly, Pocket, and Downcast), and an improved notification center (it’s something I was so happy with when iOS 5 was announced but it’s always felt so limited — now we can see a list of relevant and important information at a glance, in addition to all the missed notifications we’re collecting).

Screen Shot 2013-06-10 at 9.25.36 PM

What I’m not excited about

My one and only gripe (albeit, it’s minor in the scheme of things) are the default first party icons. (Others have been complaining about this as well.) Their overly simplistic look doesn’t really appeal to me and I’d actually argue that they look bad. I’m not sure what happened in the design process here but it’s something that detracts from the overall polish of iOS for me.

Anyway, its going to be a long wait until fall. But I’m excited about this new direction and can’t wait to see where companies like Apple, Google, and Microsoft continue to take us in the mobile space.

Book Review: Gulp – Adventures on the Alimentary Canal

Gulp: Adventures on the Alimentary Canal
Gulp: Adventures on the Alimentary Canal by Mary Roach
My rating: 4 of 5 stars

Another Mary Roach classic. Gulp: Adventures on the Alimentary Canal takes us through the body’s digestive tract. Like many books by Mary Roach, it’s sometimes gross, often hilarious, and always informative. Bonus points for beginning the story with the smell of beer and wine right here in Oakland at Beer Revolution.

She does a great job sharing relevant stories and interesting facts about each part of our digestive tract, among them:

* How smell influences what we taste
* Why we prefer crispy foods
* The history of scientific research into digestion through “fistulated holes”
* Fiber: the munchies, the myth, and the legend
* Did Elvis die from being constipated
* And lots and lots of stories related to the science of studying poo

Needless to say, this isn’t a book you want to read while eating lunch. But it did elicit a number of laughs and giggles from me while I took public transit to and from work each day. Overall, it was a pretty enjoyable and informative read. If you’ve enjoyed anything from Mary Roach before, I’d highly recommend this as well.

View all my reviews