How to do ab testing on transactional emails?
What I'm doing right now is to use the contact id to split the contacts into two buckets (if it's odd, group A, even group B). 

So in the email, I use smarty:

{if $contact_id % 2}
   one of the two texts I want to test
{else}
   and the other test I want
{/if}


And measure the result:

SELECT count(id) as total, mod(id,2) as bucket FROM civicrm_contact join whatever ... group by mod(id,2);


It's a bit of a hack and needs a bit of sql massaging, but seems to work. Do you see any problem using the id % 2 as way to randomly distribute between the groups?

And I'd like to be able to measure open rate and click rate, but haven't quite figured that one yet. Any suggestion more than welcome...