Jump to content

Recommended Posts

Hello all,

 

I have a website that uses Joomla 1.5 as a CMS - that is designed for users to register and download a software. The users are generally not that tech savy and need a reminder or some help via email. I have it set up that users need to activate there account after registration - and the activation code is sent to them via email. Now I need to send a follow up “Thank You” email 1 day after people have authenticated themselves and another email 1 week later with a basic survey regarding satisfaction so far.

 

I have looked up all the ready built extensions for Joomla and have not been able to find anything.

Can someone help me understand what would need to be done to accomplish this?

 

I'm guessing I'll need to loop through the database looking for users that have registered between 36 and 24 hours prior - and have activated their accounts (This may be a problem though if they wait more than 2 days to activate their accounts?) then send an email to the user and update some new field in the database with another time stamp for sending this email. Then loop through the db again looking for the second time stamp being older than 1 week and send another email??

 

Thanks for any help,

 

How about adding another fieldname in your DB called activation_time and then put a timestamp in there when they activate their account.

 

Then to send a follow-up e-mail a day later you can loop through the DB like the following:

  $dayAgo = (time()-(60*60*24))
  $myQuery = "SELECT email,name FROM users WHERE activated = 'No' AND activation_time < $dayAgo";
  if($doQuery = mysql_query($myQuery)) {

    if(mysql_num_rows($doQuery)) {
       while($row = mysql_fetch_assoc($doQuery)) {
          // Send Email code Here
       }
    } else {
      echo 'No e-mails need to sent.';
    }

  } else {
    echo 'This query failed: "'.$myQuery.'"';
  }

 

The do something similar for the week follow-up, but change the $dayAgo calculation to $dayAgo = (time()-(60*60*24*7))

 

This is a solution that will work, but there maybe better ones out there.

 

Regards, PaulRyan.

We need some database information here, like do you have a field like PaulRyan suggests? One that keeps record on when they registered and when they activated?

 

If you have then you can select all users like:

 

"Now I need to send a follow up “Thank You” email 1 day after people have authenticated themselves"

SELECT * FROM users WHERE activated_on = CURRENT_DATE - INTERVAL 1 DAY

 

".. and another email 1 week later with a basic survey regarding satisfaction so far."

SELECT * FROM users WHERE activated_on = CURRENT_DATE - INTERVAL 1 WEEK

 

@PaulRyan

 

SELECT email,name FROM users WHERE activated = 'No' AND activation_time < $dayAgo

 

That will select everyone with activated = 'No' regardless whether that was yesterday or last year.

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.