You might have heard of Mailchimp… who hasn’t these days! Well the same guys have released a rather nice little system called Mandrill (or did earlier this year at least). It is a transactional SMTP relax service with a rather nice little API for those who care.
For those that don’t give a monkeys (get it.. monkeys?!) I have a barebones little bit of PHP code for you to use which will effect the sending of your emails. Most sites using PHP have a central ‘mail’ command. There will be a function in a file or include somewhere which will handle the sending of mail using this sort of syntax:
mail($to, $subject, $body);
Quite simple.. it’s how PHP sends emails normally. The following code is to replace that mail command. Don’t forget to enter your API key!
$to = 'test@test.com';
$content = '<p>this is the emails html <a href="www.google.co.uk">content</a></p>';
$subject = 'this is the subject';
$from = 'test@mandrill.com';
$uri = 'https://mandrillapp.com/api/1.0/messages/send.json';
$api_key = 'YOUR KEY HERE';
$content_text = strip_tags($content);
$postString = '{
"key": "' . $api_key . '",
"message": {
"html": "' . $content . '",
"text": "' . $content_text . '",
"subject": "' . $subject . '",
"from_email": "' . $from . '",
"from_name": "' . $from . '",
"to": [
{
"email": "' . $to . '",
"name": "' . $to . '"
}
],
"track_opens": true,
"track_clicks": true,
"auto_text": true,
"url_strip_qs": true,
"preserve_recipients": true
},
"async": false
}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($ch);
You can also echo the $result variable to debug this code.. it will return a string of JSON with either a success message or an error. Rather useful I think!








On the 6th of March (I think) the lovely guys at WooThemes graced us with a lovely new version of their fantastic WooCommerce plugin. They changed a lot of things, most of which I have yet to absorb. A couple of notable things though caught my eye. You may or may not be aware that I have written a few tutorials concerning the WooCommerce tab system. Adding new ones and, of course, removing the reviews tab. Since 2.0 the product tab API has been updated and is now somewhat slightly more elegant.
Some background perhaps.. Nigeria, as a nation, has a huge amount of stigma around it after various different online scams and a general feel of corruption about it. In fact I am sorry to say that the people of Nigeria have it incredibly hard on the internet and to make money is especially difficult because the big reputable payment processors like PayPal are not available to them. This is rather frustrating because over the last few weeks I have met and worked with (even outsourced work to) various Nigerian people and I have not got a bad thing to say about any of them. It’s sad, in my opinion, that the lack of PayPal hinders international business the way it does.
This was requested by a commenter on a 

