Isaac Asher Posted September 2, 2018 Share Posted September 2, 2018 I have a custom client field which I use to store a date. I would like it if I could schedule an email to go to the client on that particular date (and/or in consideration of other custom fields) via the cron job, if possible. Does anyone know if it's possible to add such automation via the admin? If not, where can I go to learn more about the method to do this? I can work with PHP, HTML, CSS easily enough, so that won't be an issue. Thanks in advance! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted September 2, 2018 Share Posted September 2, 2018 As far as I know not via Admin interface. You'll need an action hook like this one. function customPrefix_PreCronJob() { // Get clients matching your criteria in $clients variable foreach($clients as $client) { $postData['messagename'] = 'Your Message'; $postData['id'] = $client['id']; $postData['customvars']['something'] = $client['something']; localAPI('SendEmail', $postData); } } add_hook('PreCronJob', 1, 'customPrefix_PreCronJob'); 1 Quote Link to comment Share on other sites More sharing options...
Isaac Asher Posted September 5, 2018 Author Share Posted September 5, 2018 Thank you so much, @Kian! This is very helpful!! 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.