• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Mailinglist recipients from SQL database

dennis_81

Basic Pleskian
Hello,

I am looking for a way to get the eMail recipients of a mailinglist from a SQL database. I know this possibility e.g. from IceWarp. There I could read out with a SELECT query from a MySQL database, to whom a mailinglist forwards the messages.
Can I implement something like this with Plesk?

Thanks for your answers
 
If I'm not mistaken list of subscribers is not stored in the Plesk database. But you can get this list with the appropriate CLI utility:
Code:
# plesk bin maillist -i maillist -domain distracted-nightingale.128-19-131-120.plesk
Mailing list members:
[email protected]
[email protected]
[email protected]
SUCCESS: operation with mailing list 'maillist' complete.
 
Hello,

thank you, but maybe I didn't explain it correctly:
I do not want to use the Plesk database but an external database. We have a MySQL DB for personnel management. In this database are also the employees with departments and mail addresses. I would like to automatically add all employees who are in department A to the distribution list [email protected].
 
You could do this aslo using the Plesk CLI. To add an email address to an mailinglist to can use:
Bash:
plesk bin maillist --update MailinglistName -members add:[email protected] -domain example.com

You'll have to write a script to export the email addresses from your database and add those email addresses to the mailinglist using the code example above. More information on the Plesk CLI can be found here: maillist: Mailing Lists
 
Thank You @Rasp
How can I make entries here? Is that only possible via the Plesk CLI? Do I have to schedule it via cronjob? Or can I for example also edit this via PHP on a website?
 
@dennis_81
unfortunately there's no ability to do that via API, so adding the script with CLI commands to the cron looks good.
 
Back
Top