Taktak Posted October 6, 2014 Share Posted October 6, 2014 We have managed and finalized now a PHP page, which send automated HTML formatted emails to the clients. This codes are NOT a module and are open to modification and adjustments. We are not PHP experts and had a quite hard time as well as some fun, developing it. There is no automated installation routine. The current code contains a PDF file with detailed instructions how to install and configure required settings. The PHP code, containing a basic "Happy Birthday Email" which can and should be modified is included as well as the documentation, how to adjust some of the features of the email. The code file as well as the documentation can be downloaded a zip file from /https://portal.it-bizz.net/cart.php?a=add&pid=186&sld=whmcs&tld=.com Pricing: USD 5.00 including basic installation support by email 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 6, 2014 Share Posted October 6, 2014 Hi You could use the in-built Email features of WHMCS instead of calling a separate script. You could just create a new multi-language Email Template under Setup > Email Templates then query database to get the IDs of all clients that were born today. SELECT clientid FROM someteable WHERE birthdate = CURDATE() Then you iterate IDs in a foreach to send emails via internal API: foreach($clients AS $id) { $command = "sendemail"; $adminuser = "admin"; $values["messagename"] = "Happy Birthday Email"; $values["id"] = $id; $results = localAPI($command, $values, $adminuser); } You have to run this script on daily basis automatically so maybe the best approach is to hook it to DailyCronJob Action Hook. function BirthDay_Email() { // query db, iterate and send email via API } add_hook("DailyCronJob",1,"BirthDay_Email"); Done. 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted October 6, 2014 Share Posted October 6, 2014 yeah i have been recording the birthday for awhile now and either way would be nice. I will look into this. 0 Quote Link to comment Share on other sites More sharing options...
Taktak Posted October 7, 2014 Author Share Posted October 7, 2014 Hi Kian, your code looks nice. However, we are still novices and attempted our best 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 7, 2014 Share Posted October 7, 2014 Well most of things I wrote was pseudo code Anyway there's only one thing missing in your project in my opinion. Thre should be a security measure to prevent clients to cheat on their birthdates. Let's suppose that as gift you send coupon codes via email. One of your client could change his birthdate everyday to get birthday gifts 365 times per year. Of course I'm supposing that clients can change this value from client area (can they?). 0 Quote Link to comment Share on other sites More sharing options...
adroitssd Posted October 7, 2014 Share Posted October 7, 2014 Am I need to send email manually for every users? 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted October 8, 2014 Share Posted October 8, 2014 All you have to do is have a token field in the table and load the token when the bd is rendered. Once that is done then it cant be done til the next year. Also you could easily just use an encrypted token with the original dob and compare it to that to keep people from cheating the system. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 8, 2014 Share Posted October 8, 2014 Nhaa I don't like this approach. I mean it works but why do you want to store a pointless token in database while you simply need to "hide" birthdate input field to clients once they register? No additional data to store and less coding. 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted October 8, 2014 Share Posted October 8, 2014 The main reason i suggested what i did was because it would mean no template mods. Hiding a custom field would mean a template mod which would need to be replaced every time a whmcs occured. Yes the db is more work up front but less to worry about overall, it just does its job and no hassle at updates. Also there is no reason to hide it, just after they register then make it read only. They can see it but cant change it. 0 Quote Link to comment Share on other sites More sharing options...
Secmas Posted November 30, 2021 Share Posted November 30, 2021 Hi everyone, sorry to resurrect and old thread, but it is what I am looking to implement in my service. Have you been implemented this in your WHMCSs? Best Regards, Sergio 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.