I haven’t integrated it into MODx, but it works pretty well alongside it. Having a separate Pommo admin interface is actually better for most of our clients because that way they can hand off newsletter mailing and processing to people with absolutely no MODx manager access. When someone asks us to make a module to integrate the two, I don’t expect it will be very difficult.
I use a version of eForm2db to add subscribers to the Pommo database when they fill out forms in MODx. The latest one is a contact form with an "Add me to your mailing list" checkbox, so if a user checks that they are added to the Pommo list (assuming their email is not already in the Pommo database). It was a pretty quick and dirty hack, but here is the code in case it might be useful to someone else:
<?php
function save2Pommo(&$fields){
global $modx;
if($fields['list']=='Added to mailing list'){
$query="SELECT * FROM pommo_subscribers WHERE email='".$fields['email']."'";
$result=$modx->db->query($query);
if($modx->recordCount($result)<1){
$subscriberInfo[email]=$fields['email'];
$subscriberInfo[time_registered]=date('YmdHis');
$subscriberInfo[status]=1;
$dbQuery=$modx->db->insert($subscriberInfo,'pommo_subscribers');
$subId=$modx->db->getInsertId();
$subscriberField1[field_id]=1;
$subscriberField1[subscriber_id]=$subId;
$subscriberField1[value]=$fields['Name'];
$dbQuery=$modx->db->insert($subscriberField1,'pommo_subscriber_data');
$subscriberField2[field_id]=2;
$subscriberField2[subscriber_id]=$subId;
$subscriberField2[value]=$fields['lastName'];
$dbQuery=$modx->db->insert($subscriberField2,'pommo_subscriber_data');
$subscriberField3[field_id]=3;
$subscriberField3[subscriber_id]=$subId;
$subscriberField3[value]=$fields['zipCode'];
$dbQuery=$modx->db->insert($subscriberField3,'pommo_subscriber_data');
}
}
return true;
}
return '';
?>
The main Pommo subscriber database table is pommo_subscribers, and the table with custom fields is pommo_subscriber_data. In this case we have three custom fields (first name, last name, and ZIP code), and they’re numbered 1,2, and 3 respectively. Like eForm2db, this script only does what you specifically tell it to do, but it’s pretty easy to modify for other purposes (see the eForm2db thread for more info).
If all you want is a Pommo signup form, of course, then you can just use the forms generated by Pommo itself for that...
All things considered, I really like Pommo and especially those of you who use or have clients who use horrible services like Constant Contact should give it a try.