Every week, our client (a church) prints and hands out study and resource cards to both children and their parents on Sunday. As you can imagine, this exercise can get expensive because
- It’s not always easy to print the right number of cards every week so there’s either some amount of waste or time wasted making more copies
- It takes time for staff to do this. While this is important work for them, but I’d chance to say it probably ranks lower in the big picture
- Printing or copying costs money, even when you do them yourself. For a church – and any fiscally responsible organization – saving even a little bit means more money can be spent on more important areas
Naturally, they decided to stop printing and begin delivering these resources online via their website.
The not so great part about that, someone had to change out the links to these resources every single week. So there’s still some manual intervention required. Because I am their webmaster and this is a pro bono account, it is a good idea to be as efficient as possible. Being charitable is great and highly recommended but this also means we need to get smart about it or end up losing a ton of man hours. Besides, I’m not always good at working on Sunday night and have forgotten more than once – oops!
Since they get 4 weeks of these printable resources at a time and I love to batch my work, I decided to make use of technology (big surprise right?).
First, all the 4 weeks’ worth of resources got uploaded online. It really doesn’t matter where. In this case, they used Amazon S3.
Next, I grabbed the URLs to these resources and temporarily saved them because I’d need them here shortly.
Then, I wrote a small bit of code. This code checks today’s date against a list of dates when the resources should be changed. If today’s date is before or the same as the end of week 1, the website should publish the URL to resource 1.
Finally, this code is copied into the theme’s functions.php file (they use WordPress) and for easier display, I made a shortcode for it. Now, I can put the shortcode in a post.
And just like that, every Sunday morning, the links to these resources are automatically changed and I don’t have to do a thing until 4 weeks later. Kinda makes me wish they could get it months ahead of time so I can work even less often
The example code can be downloaded below. It is a little rough around the edges and simplistic. Definitely something that can be improved or made into a more robust shortcode. I was in a hurry. Still, it works well and something you can easily implement if you have a similar need.
(right click save as or click to view)