Monthly Archive for August, 2011

Dealing with sold out products and the PayPal BMSetInventory API method

I’ve just built a WordPress custom post type which allows you to sell a few simple products on your site by interacting with the PayPal Button Management API. (It wasn’t easy. PayPal’s documentation is full of duplicated informal, distributed all over the place, and badly maintained.) One thing which isn’t mentioned in the documentation is that you can use the BMSetInventory API method to stop customers buying products when they are sold out… which is kind of critical, when you think of it. Continue reading ‘Dealing with sold out products and the PayPal BMSetInventory API method’

Handy sendmail debugging commands

Some sendmail commands I’ve just found useful, but couldn’t locate on Google.

Get the current status of a message in the queue: grep  'james@example.com' /var/log/maillog

Get the headers for an email: cat /var/spool/mqueue/qf[message ID]

Get the body of an email: cat /var/spool/mqueue/df[message ID]

(Many thanks to my old friend Mr Matt Westby for his help with this.)

Gravity forms access for editors

Gravity Forms is an excellent WordPress plugin, which allows flexible and easy control and creation of pretty much any kind of form in your website. Behind the scenes it has a very flexible integration with the WordPress system of roles and capabilities, which governs who can do what in your admin area. Continue reading ‘Gravity forms access for editors’