List of users vs. SQL database of customers

Mr.Scully

New Member
Hi, I installed MailWizz a couple days ago and I'm still considering how to use it. I'm talking about the list of newsletter recipients. I have a SQL database of customers and this database is growing every day. Also there are duplicates in there (a customer can do multiple purchases so he appears in the database again and again). I would like all these customers (incl. the new ones) to appear in the list of newsletter recipients automatically (without having to sign in anywhere). What is the best way to do it? I can do CSV or SQL imports manually (for example every week) but that's not very comfortable. Also if he signs off from the newsletter in the meantime and I add him in the next import (because he made another purchase AFTER he signed off the newsletter), does the import script check for him in the signed-off recipients list or would it add him again?

Can you advise what's the best way how to solve this? It's easy to do one-off imports but I need something automated that I wouldn't have to do manually every week or so. Also I don't know if the import does or doesn't add users who have already signed off in the meantime...
 
Hey,

The importer will check for duplicates, so you won't have same email address twice.
Secondly, in order to automate this use case of yours, the key is to use the API, (see: https://github.com/twisted1919/mailwizz-php-sdk)
You can set it up so that after a new customer is added in your database via whatever system you use, to use this api and send it to mailwizz too, or, you can have a cron job to run once at X hours and check your database of subscribers that have been added in last X hours and then send them to mailwizz one by one. Eitherway you do, using the API is the solution.

Thanks.
 
Brilliant, thank you - I have probably overlooked the API tutorial download link. Now I'm browsing it and reading the examples. It's really good that the customers are kept in the list even though their status is "unsubscribed" - because duplicates are avoided this way.

The "adding subscriber" example says "the confirmation email will be sent!!!" - is there any way or attribute to add a subscriber without sending an email to him? I want to avoid all kinds of confirmation emails. The customers will be added automatically (an unsubscribe option will be in the footer of each newsletter) and I don't want to send him any confirmation emails at all.

[edit] Or perhaps the confirmation email is not sent if the list of subscribers is in the single opt-in mode? I thought I'd better ask before I launch a script that adds 2000 subscribers via this API :-)
 
Last edited:
Or perhaps the confirmation email is not sent if the list of subscribers is in the single opt-in mode? I thought I'd better ask before I launch a script that adds 2000 subscribers via this API
Yes, you are totally right, no email is sent when single opt in because there's nothing to confirm.
 
I will continue in my thread because my next question is related to my original question :-) I'm currently using the API to add, delete or list subscribers. But there's one thing I can't find - how to tell whether the user is or isn't subscribed to a list? I can use the emailSearch() or getSubscriber() classes to find a particular subscriber but it returns "success" (and the subscriber's ID) if the user IS in the list - but it doesn't say anything about whether he is or isn't subscribed at the moment. Is there any way how to find that out? Some kind of attribute in the response?

(The reason I'm asking about that is that I want people to subscribe/unsubscribe in a special section on my website - so I must be able to tell them whether they are subscribed or not at the moment :)
 
Man, you're brilliant, thank you for the quick response :-) Speaking of the status, can I also update his status via API? I mean can I update user's status from "unsubscribed" to "subscribed"? Because if I try to add him, it won't do anything (duplicate) and updating seems to work only for his personal data, not for the status itself?
 
Changing status directly might have other implications because the subscriber has to explicitly subscribe in your list by confirming.
You could add a new endpoint in the API to do this, should be simple enough given the examples you have.
 
Back
Top