Yoh Asakura 9 Posted May 11, 2015 Hi, I was talking to @@Dastgir and I've asked if it's possible to send an automatic email to those players that didin't log in the server for more than 20 days. The automatic message would be sent to the email that the player has registered. Many servers nowadays has this, but I still don't know how to do it. I also would like to know how to send emails, like adverts to the player's email. I saw many servers that does it, and it's really good. Kind Regards. Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted May 11, 2015 Like I said , They use SQL and php, they save emails on different table, so it doesn't interfere with server using SQL. Then php performs query and selects all email and dates from table , uses simple if condition to check time logged in, then send email accordingly. If someone could provide script, that would be good.(currently too busy to code one) Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted May 11, 2015 by the way be warned that doing it might make all e-mails going into spam/trash folder, the best way of contacting players thru mail is using a subscription system in your website where the player will be able to choose whether they want or not to receive e-mails Quote Share this post Link to post Share on other sites
trickyloki3 8 Posted May 12, 2015 (edited) It is very easy with Python. 1. Create an email account 2. Select a SMTP server (Microsoft or Google) 3. Create MySQL user account with select privileges on last login column in login table. 4. Connect to MySQL server using limited privilege MySQL user account with SqlAlchemy (http://www.sqlalchemy.org) 5. Query database and calculate the datetime difference to get timedelta, which gives number of days, hours, and seconds. (https://docs.python.org/2/library/datetime.html) 6. Send email via SMTP server for all user's last login > 20 days. (https://docs.python.org/2/library/smtplib.html) 7. Create separate user account on system. (https://pypi.python.org/pypi/python-crontab) 8. Schedule script on crontab to run on some interval using new user account. Can be done in less than 100 lines. (Unless you want to use the ORM to map all the tables.) Deploy on some cloud instance 1. Buy a cloud instance for $5 per month or less. 2. Setup SSL certificates for MySQL server master and slave. (Self-signed root CA is ok) 3. Setup Iptables to allow cloud instance to connect on MySQL port. 4. Setup MySQL slave replication. 5. Write automation script that use slave replication server. (Which also double as backup) Edited May 12, 2015 by trickyloki3 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
Kong 9 Posted May 15, 2015 (edited) Easy mate, use http://mailchimp.com/ It's free until you reach 2,000 emails/subscribers. You simply create a list and then you populate the list with emails either from a csv/text file, excel, google contacts, etc. There's also a limit of 12,000 emails per month. Edited May 15, 2015 by Kong Quote Share this post Link to post Share on other sites