PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

[MODULE] Phplistsync

33 replies to this topic
#1
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Phplistsync Module synchronize the customers of Prestashop with PHPList, a well known newsletter software written in PHP.

All the new customers added in Prestashop are copied to the PHPList database. The customers that have chosen to not receive any newsletters are copied to PHPList anyway but they are flagged as "disabled". This is important in order to preserve the coherence between databases.
Every modification made on the customers choice regarding the newsletter notification will change the state of this flag in PHPList at each synchronization.

Is a first release, so please be aware of possible bugs.

Here is the link to the module:
http://www.prestasho...lo_phplistsync/

Thanks

#2
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Version 0.2 now available ;)

#3
Star

    PrestaShop Addict

  • Members
  • PipPipPip
  • 618 posts

From 1243632448:

Version 0.2 now available ;)


Thanks for sharing

#4
Star

    PrestaShop Addict

  • Members
  • PipPipPip
  • 618 posts

From 1243632448:

Version 0.2 now available ;)


Did you set up a donation box? I would very much to make a donation to you.

#5
Newest

    PrestaShop Apprentice

  • Members
  • PipPip
  • 101 posts
This is a very good module. It save us a lot of headache. Thank you.

#6
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Star, too kind from you!
No I haven't planned to set up a donation box, should I have done? ;) hehehe

I consider your proposal like one of the most gentle appreciation to my work! Thank you very much!
In any case you don't have to worry, enjoy my module for free, I'm happy to know that someone has found it very useful.
Think that, at the moment, I don't even need it personally! ahaha

I'll call you for a drink if I ever come to the beautiful California! ;)


Newest thanks to you as well!

#7
Newest

    PrestaShop Apprentice

  • Members
  • PipPip
  • 101 posts
Hi,

Is there a way we can put a selection link or button for the prefer HTML format on the front of the news sub block and connect it to the phplist module?

Very appreciate your work.

Attached Files



#8
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Hi Newest,
the option to prefer HTML format or plain text format is something that has not been considered in Prestashop's users information.

Another issue is that the block newsletter works in a total stand alone way.
A new table different from the one containing the customers of your shop is created when you install this block and the emails subscribed through this block are just saved as a sample email archive.
The Phplistsync module synchronize Phplist with the customer that have choose to receive newsletters on their profile and not with this list of addresses of "unknown" people.

I didn't consider this newsletter block because in Italy, as it is, is also out law since it should have a discalimer informing the subscriber about his privacy rights.

Also if a customer subscribe himself to the newsletter and then register his account choosing to not receive any newsletter the situation is confused because on the customer table the receipt of newsletter is disabled and on the other table i enabled... what's the right one?

I think the best thing to do is to take things from the opposite side.
Phplistsync is useful because we need to keep the customer DB synchronized with the newsletter application when a new subscriber register himself in your shop in order to became a customer (in this case we need to register the users in both Prestashop and Phplist).
If you just want to handle email addresses of people that just want to be informed about your commercial activities you don't need to involve Prestashop, you just need to register the users in your newsletter application, so Phplist.
To do this you could modify the newsletter block in order to post your users data directly to a subscriber page that you have created in Phplist, in this way you can also handle the HTML or plain text option with all the other features of Phplist subscription steps.

#9
Newest

    PrestaShop Apprentice

  • Members
  • PipPip
  • 101 posts

From 1246572917:

Hi Newest,

I think the best thing to do is to take things from the opposite side.
Phplistsync is useful because we need to keep the customer DB synchronized with the newsletter application when a new subscriber register himself in your shop in order to became a customer (in this case we need to register the users in both Prestashop and Phplist).
If you just want to handle email addresses of people that just want to be informed about your commercial activities you don't need to involve Prestashop, you just need to register the users in your newsletter application, so Phplist.
To do this you could modify the newsletter block in order to post your users data directly to a subscriber page that you have created in Phplist, in this way you can also handle the HTML or plain text option with all the other features of Phplist subscription steps.


Thank you. Will try your suggestion. Thanks

#10
Star

    PrestaShop Addict

  • Members
  • PipPipPip
  • 618 posts

From 1246566572:

Star, too kind from you!
No I haven't planned to set up a donation box, should I have done? ;) hehehe

I consider your proposal like one of the most gentle appreciation to my work! Thank you very much!
In any case you don't have to worry, enjoy my module for free, I'm happy to know that someone has found it very useful.
Think that, at the moment, I don't even need it personally! ahaha

I'll call you for a drink if I ever come to the beautiful California! ;)


Newest thanks to you as well!


That is so nice of you Sir,

Thank you very much.

#11
google-friend

    PrestaShop Apprentice

  • Members
  • PipPip
  • 66 posts
Hi mannybiker,

I am new here. I know phplist is a very good program. Thank you for doing it.

I have a question. I just work for this company for 2 days. I am very new, I need to shine, you know. My boss wants to move the newsletter block to the center AND the footer. Do you know how can i move the newsletter block to the center of the home page? And to the footer? I am very appreciated your help.

#12
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
google-friend, try to check if what you are searching is in the Back End, tab Modules, menu Position in the left up corner. There you can change the position of your blocks.

#13
google-friend

    PrestaShop Apprentice

  • Members
  • PipPip
  • 66 posts

From 1246864403:

google-friend, try to check if what you are searching is in the Back End, tab Modules, menu Position in the left up corner. There you can change the position of your blocks.


Thank you. I tried all ways. But I think it can not move to the center page. I am able to move it to the home page, butno luck to move to center page.


Thank you for your help.

#14
Belle&Blackley

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
please help.....I'm getting this message when I'm trying to configure...Warning: Invalid argument supplied for foreach() in /vhost/vhost8/b/b/e/bbe-boutique.co.uk/www/modules/phplistsync/phplistsync.php on line 76
using version 1.2.0.1 - 0.071s

#15
jhugues

    PrestaShop Apprentice

  • Members
  • PipPip
  • 52 posts
Hi mannybiker

your module is very interesting

I have installed it, as well as phplist.

imports of csv file went ok

When i used “check db” it tells me one customer needs to be added and no customer needs to be updated. everything is ok up to here.

however when i do “synchronize db” I get an insert error. The user has full rights on the db

any idea ???

thanks in advance

puo respondere in Italiano, Inglese o Francese. grazie
www.castelasshop.fr 1.4.4.1
www.castelas.com

#16
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Belle&Blackley;, at line 76 the script try to list, on the listbox showed in the configuration form, the lists of distribution available in phplist (the default one should be "test").
Since this is the first action done on the phplist DB, the problem could be that the query, that should read the list information on the DB, goes wrong somewhere, probably because it does not find the Phplist DB. Try to double check the install procedure, there some constants that need to be set _PHPLIST_DB_ and _PHPLIST_PREFIX_ and also verify that de phplist db is installed on the same instance of Prestashop DB and it has the same access rights.

Hope this help.

#17
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Ciao jhugues,

innanzi tutto grazie per l'interesse e complimenti per tutte le lingue conosciute. ;)

Il problema sembra arriare da questo insert:

INSERT INTO _PHPLIST_DB_+_PHPLIST_PREFIX_user_user (email, confirmed, uniqid, blacklisted, entered, htmlemail, disabled, foreignkey)
VALUES ("$user['email']", 1, Uniqid(), $active, NOW(), 1, $active, $user['id_customer']);

dove:
$user['email'] = in base al valore recuperato dal DB Prestashop e dal campo email (stringa)
Uniqid() = un ID unico generato dalla funzione nel modulo (stringa)
NOW() = data e ora corrente (datetime)
i$active = in base al valore recuperato dal DB Prestashop e dal campo newsletter, 0 se non inscritto, 1 nel caso contrario (numerico)
$user['id_customer'] = in base al valore recuperato dal DB Prestashop e dal campo id_customer (stringa)

Per prima cosa verificherei che i campi della tabella phplist_user_user (se hai mantenuto i prefissi di default) siano presenti e che siano dello stesso tipo indicato, controlla che sia stato creato il campo foreignkey durante il primo import (controlla la procedura di install che ho scritto al punto 8)

Poi potresti provare a eseguire il comando di insert qui sopra modificando manualmente le variabili con dei valori di prova per vedere che errore viene generato (io uso MySQL Query Bowser) tipo:

INSERT INTO phplist_user_user (email, confirmed, uniqid, blacklisted, entered, htmlemail, disabled, foreignkey)
VALUES ("test@test.com", 1, "81d7ba7f1b672821c6c16a15836d4b5f", 1, 2009-05-30 00:14:04, 1, 1, 15);

Purtroppo non potendo riprodurre il tuo problema non riesco a darti indicazioni più precise.
Spero di esserti stato di aiuto.

#18
jhugues

    PrestaShop Apprentice

  • Members
  • PipPip
  • 52 posts
Bongiorno et grazie per la sua risposa,

Prosegue in Inglese perche ci sono altri che possono avere interessi in questo problemo.

I have found that if I remove the "Unique" attribute of the email index in phplist table (and select INDEX) I eliminate the problem.
I looks like it is not possible to enter a user with the same email, although this should not be a problem since Phplist checks for doubles when sending the mail.

To improve the module, I would recommend you test for the $return code (back from the sql request) to determin what the error was and act upon it or at least tell us what the error is.

As I said your module is great complement to PS and I like the way you built it. Simple and graceful like many Italian designs!
www.castelasshop.fr 1.4.4.1
www.castelas.com

#19
mannybiker

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts
Hi jhugues and thanks again for your kindly appreciation.
I'm happy to know that you have found the problem.

From my point of view the fact that you cannot have a duplicate email it is correct, since in prestashop people could only subscribe once with a certain email.
I also tried to do my work without modifing the code from phplist and prestashop, since I tried to create a module that works in most cases and without asking to the users to use a non-standard version of the programs or DBs involved in the job. I think you could understand my opinion.

In anycase you are right regarding the return code, it is something that I wanted to add when I created the error function. The insert error was just a placeholder to put then a real error code, but I haven't found the time to do it yet! Very sorry about that! I will try to implement it in the next release.

Thanks for your interest!

#20
jhugues

    PrestaShop Apprentice

  • Members
  • PipPip
  • 52 posts
I totally agree with you with the fact that one should try to avoid modifying the db or ps code.

I am looking forward to the next release of your module.

In the meantime I am happily using it !

Thanks

Jean.
www.castelasshop.fr 1.4.4.1
www.castelas.com