Page 1 of 1

Vtiger PHPListSync patch to respect unsubscribes

PostPosted: 11:45am, Fri 23 Sep, 2011
by bdeferme
We at Open-Future are using PHPList to send out mass mailings, we really like this software.

However, we are using Vtiger as a source for our contacts.

To synchronise Vtiger contacts and leads to PHPList we use PHPListSync. We were having problems however with users unsubscribing from our mailings still receiving mailings afterwards. We traced this problem back to PHPListsync.

Every time you synchronise, it doesn't just add new users but also RE-subscribes unsubscribed users. We created a small patch for PHPListSync to revert this behaviour and would like to share it here for people using the same kind of setup.

!Warning! This patch has some side-effects. If you apply it, and you do a resynchronisation from Vtiger to PHPList, people who were already synchronised but their membership has changed will not be updated! However, we just use PHPListSync to synchronise new users to the lists, and do list management directly in PHPList.

Appearantly .patch or .txt are extensions that are not allowed so please find the patch at the bottom of this post.

Code: Select all
~# cd /path/to/PHPListSync
PHPListSync# patch -p1 < /path/to/respect-optout.patch

Some Links:

The patch homepage:
The patch download url:

Moderator edit - above respect-optout.patch is small enough to be included as code:
Code: Select all
diff -Naur PHPListSync/sync.php PHPListSync_patched/sync.php
--- PHPListSync/sync.php   2011-04-13 09:56:58.000000000 +0200
+++ PHPListSync_patched/sync.php   2011-09-23 12:12:16.000000000 +0200
@@ -56,7 +56,8 @@
             } else { #If the query returned anything, a user is in system, but not the right list.. let us fix that
-                AddExistingUser($strippedstring,$listid);
+                # AddExistingUser($strippedstring,$listid);
 //                logToFile("Email $strippedstring is in the newsletter system, but not the right list ($listid). I am correcting this now.");