Postmark library for CodeIgniter

Friday afternoon I received an invite to try out the beta version of Postmark, a transactional e-mail delivery service from Wildbit, the guys and gals who made Beanstalk and Newsberry. What are transactional e-mails, you might ask? The answer is: e-mails generated by a web application after an user action such as registration, requesting a password reminder, receiving a reply to a comment, etc. The problem me and many developers faced is that sometimes the client’s servers are blacklisted and these e-mails land in the users’ spam folder. This is where Postmark comes to the rescue, hopefully – instead of using the built in mail function of your web development language of choice you issue a call to Postmark which sends out the e-mail from their “well regarded” servers so that hopefully they land in the user’s inbox.

To give something back, I’ve put together a CodeIgniter library for this service. This grants easy integration of Postmark with your CodeIgniter web app: you upload two files, fill in your API key then include the library where needed and send mails away.

Download & credits

Get it here.

You can contribute to this code here.

Based on Markus Hedlund’s Postmark class for PHP.

Installation

Upload the contents of the cipostmark folder from the archive to the root of your CodeIginiter install directory (on Mac be sure to merge with the existing folders). Basically Postmark.php (with capital P) needs to sit in /system/application/libraries/ and postmark.php needs to be uploaded to /system/application/config/ – Before or after uploading edit the configuration file (postmark.php) and fill in your API key.

Usage guide

Now you can use the library in your web app:

$this->load->library('postmark');
$this->postmark->from('from@example.com', 'From Name');
$this->postmark->to('to@example.com', 'To Name);
$this->postmark->subject('Example subject');
$this->postmark->messagePlain('Testing...');
$this->postmark->messageHtml('<html><strong>Testing...</strong></html>');
$this->postmark->send();

… or you can specify all the parameters in the send() function like this:

$this->load->library('postmark');
$this->postmark->send('from@example.com', 'From Name', 'to@example.com', 'To Name', 'Example Subject', 'Testing...', '<html><strong>Testing...</strong></html>');

If something goes wrong the library and the Postmark service outputs quite user friendly error messages.

Hopefully this will come in handy for some of you.

Cavnic by night

Alrighty, after that post added before we left the house, here are not one but two fresh videos from Cavnic. Made tonight:

Best enjoyed in HD (720p). I’m off to sleep.

Suior by night

For the few of you that haven’t been spammed with this the last two days via Twitter, Facebook, Flickr and my Messenger status, here’s Ioana and me riding the nearby slope of Suior by night.

This was the first real test of the gadget I got for Ioana’s birthday (but for myself too, to be honest), a GoPro HD helmet cam.

The end of another era

I just uninstalled Winamp.

I’ve been a Winamp user since the autumn of 1998 when I got my first computer but I used it even before that on various friends’ computers. Look how enthusiast I was when Winamp 5 came out back in 2003 after the mess that Winamp 3 turned out to be. However, I had enough. Now when I uninstalled it with Revo Uninstaller I noticed that it left behind not less than 1500 registry entries – which were subsequently deleted – I haven’t even checked the directory size but I guess that I can safely say that 1500 leftover registry entries is bloat. Plus it always insisted on updating and installing stuff I never needed – toolbars, bundled software, you name it. Yep, pure bloatware.

I’ve been having an affair with foobar2000 at my last job, mostly because I had a less powerful computer over there and Winamp was eating up too much of its resources. And now that affair turns into a full blown relationship because as of today foobar2000 becomes my main media player.

2009 – My year in pictures

On one of the evenings at the start of December I got nostalgic looking at my Flickr photos taken this year and this idea popped in my mind: how about a blog post like this? Since then this post has been brewing as a draft and it turned out huge. So grab a pack of popcorn and here we go!

Read more

Vroom vroom!

Playing Richard Burns Rally...

A photographic update to my last post. For the sake of remembering the good times.

Relaxed Christmas

Christmas Hearts

Because of the weather that sucked big time this was one of the most relaxed Christmases of the last few years. My activity consisted of sitting in front of the computer and playing games, visiting family and going out one night to have a drink with Cristi. But what really defined this Christmas was playing games on the PC.

Steam had, and actually still have, their Holiday Sale going so I fetched a couple of games at very good prices: Mirror’s Edge, Torchlight, Luminees (had fond memories of it since the PlayStation Portable times – turns out it’s not that great on PC), S.T.A.L.K.E.R., Torchlight (great hack and slash!) and last but not least Grand Theft Auto IV. I played GTA4 like a maniac these days getting to 25% completion in 32 hours of playtime. And I haven’t sandboxed at all – sandboxing in GTA means to go around shooting people or doing other bad deeds and obviously getting into trouble with the police. The game has a great story and amazing graphics, but I’m probably not telling news to anyone since it won a ton of awards last year. Unfortunately I have to keep the graphics settings to a minimum, but I can play it fluidly. Maybe a video card upgrade would be nice but I’m not sure I can allocate funds for that right now.

The non-bought-from-Steam game I played a lot these days was Richard Burns Rally. This is closely related to the Christmas present we “surprised” ourselves with with Ioana’s brother: a second hand Logitech G25 racing wheel. All I can say that the experience is a blast. You’re really “there”. I tried to qualify out of rally school last evening but I was missing the time limit by 1 or 2 seconds. This isn’t that bad considering that Richard Burns Rally is THE most realistic rally simulator for the PC. Hopefully I won’t try anything I learned in real life. Must keep in mind that our 75 horsepower Citroën C3 is not a four wheel drive 300 horsepower Subaru Impreza WRC. :-)

This is it in a nutshell.

Roll the credits! The photo illustrating this post belongs to Ioana.