Jump to content

Database Driven Auto E-Mail Schedule/Sender


pontypete

Recommended Posts

Hi all, I am wondering what the best way to do this is...

 

Take GoDaddy for example, if your domain is about to expire you will get an automatic email.

 

I am wanting to do something similar, If someone orders a Soap Dispenser, I want to send an email (if they accept to receiving emails on the order) each month asking/reminding them to top up on soap.

 

I have been reading but cant find anything adequate, I have seen something about Cron Jobs, but never heard of this before, please could you point me in the right direction.

 

Thanks in advance.

 

Peter

Link to comment
Share on other sites

Crontab (cron job) is to Linux what Schedule Task is to Windows.

 

Crontab reference

 

What does this all mean?  Well, you create a php script that does the desired task, then set the crontab to execute that script at a certain time.  To list out your example, it would flow as.

 

Crontab calls a php file.

The php file checks to see if someones domain is about to expire, if it is and they are not flagged as email sent, they are sent an email.  Then their account is flagged as email sent.  Script ends.

Link to comment
Share on other sites

What jcbones said above is absolutely correct.

 

I produced a "mini CRM" for a client of mine which does a very similar task.

 

My client installs fireplaces, gas stoves etc and can also provide servicing for all the products they install (to comply with warranty). My system allows them to enter client details, add jobs and schedule when services are due (11 months from the job date), it will then produce an email that reminds my client that x amount of services are due of which they can then act upon.

 

To give you another example like above but for your specific situation:

 

You have a database that collects customer information once they purchase a soap dispenser.

Every day at 7am a cron tab or cron job (these are really easy to setup in an admin panel such as CPanel but can also be done manually) executes a PHP script that does the following:

 

Check the database for customers who purchased a soap dispenser.

Check that the customer is happy to be emailed.

Build the email (Dear John, don't forget new soap for your "xj2000 super soaper", click here to order.....) etc

Send the email.

 

etc

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.