We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    You can access the template feature when composing a new mailing, it works fine for me but only tested FF not safari I confess...
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 10298
      • 53 Posts
      Hi
      is there any news about integrating this great mailing list software into modx
        • 33372
        • 1,611 Posts
        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.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 24292
          • 28 Posts
          There is a Pommo API to do this.
          Basic add and remove subscriber below.
          <?php
          require('pommo/bootstrap.php');  // path to where Pommo installed
          Pommo::requireOnce($pommo->_baseDir.'inc/helpers/subscribers.php');
          
          function add_subscriber ($email, $firstName, $lastName) {
              // create subscriber object
            $subscriber = array(
             'email' => $email,
             'registered' => time(),
             'ip' => $_SERVER['REMOTE_ADDR'],
             'status' => 1, // 0: Inactive, 1: Active, 2: Pending
             'data' => array (1 => $firstName, 2 => $lastName) // fields depend on Pommo subscriber fields you have setup
            );
            
            if (PommoHelper::isDupe ($email)) {
              $id = PommoSubscriber::getIDByEmail ($email);
              $subscriber ['id'] = $id [0];
              return PommoSubscriber::update($subscriber);
            }
            else 
              return PommoSubscriber::add($subscriber);
          }
          
          function remove_subscriber ($email) {
            $id = PommoSubscriber::getIDByEmail ($email);
            return PommoSubscriber::delete($id);
          }
          ?>
            • 33372
            • 1,611 Posts
            Interesting. I wonder if that would work in conjunction with eForm processing (commenting out or altering those return statements), and if it does if it would slow processing down by much in loading the Pommo libraries. It seems like it would make a second connection to the database that way as well, which would be fine if Pommo were in a separate database but a lot slower if it’s in the same one.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 24292
              • 28 Posts
              I haven’t had time to try with eForm but I don’t see why it wouldn’t work.
              Where I have used it, the Pommo database was separate from MODx and I didn’t see any speed problem.
              It should be OK even if they share the same database unless the website has hundreds of subscriptions a day. The websites I’ve used it on have a lot less than that.
                • 22586
                • 74 Posts
                Is there any integration work being done at the moment? I am about to get my hands dirty with this, and I like to know if people have succesfully integrated POMMO into their site.

                POMMO looks amazing and seems to work great for a program so early in its development phase.
                • I would love to see the list management features of poMMo integrated into MODx and let MODx handle the mailings that need to be distributed. I think one of the areas of poMMO that needs to be beefed up though is the automatic bounce handling and reporting.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 34017
                    • 898 Posts
                    Ryan,

                    How would you see MODx handling the mailings? What functions would you want MODx to handle?

                    Chuck
                      Chuck the Trukk
                      ProWebscape.com :: Nashville-WebDesign.com
                      - - - - - - - -
                      What are TV's? Here's some info below.
                      http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                      http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                    • Actually not the mailings but the templates/content/etc. ... think the way Campaign Monitor allows you to import externally hosted designs.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me