Jump to content

Silver Mountain

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Silver Mountain's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm thinking "foreach" construct might be what I'm looking for. Feeding the brain cells right now. More to come.....
  2. Yep... I wrapped it with the "while..." statement and it sent an email to the last person in the query with everyones appointment in the database, so I removed the do{ if ($row_rsnotifier[nick_name] != '') $message .= "$row_rsnotifier[nick_name] is due on $row_rsnotifier[hmfollow_up_date] <hr color='#FFCE00' size='1'><br />"; } while ($row_rsnotifier = mysql_fetch_assoc($rsnotifier)); from $message, and ran the script again at which point an email was sent for each appointment in the database. Which is good, but two of the appointments were tied to one email address, which meant the customer received two emails about two different appointments. I need to determine how to capture all appointments from the database and then break them out based off of the customers email and populate an html email message and send one email for each address that has an upcoming appointment be it one or many appointments. Thank you.
  3. Hello, I am trying to email my customers with appointment reminders - however, my script will send the email to the last email in the query. What is happening with this script is the last email in the loop is receiving everyones appointments in addition to their appointment. I need each person that has an upcoming appointment receive an email with just their information from the database in the message of the email. <code> $query_notifier = "SELECT users.email_address, users.username, artists.nick_name, artist.follow_up_date, DATE_FORMAT(follow_up_date, '%b %d, %Y') AS hmfollow_up_date FROM users INNER JOIN artists ON users.username = artists.username WHERE internal_parasite.follow_up_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY)"; $rsnotifier = mysql_query($query_notifier, $db); if (!$rsnotifier) { echo "Could not sucessfully run query ($query_notifier) from DB: ". mysql_error(); exit; } if (mysql_num_rows($rsnotifier) == 0) { echo "no rows found, nothing to print so am exiting"; exit; } while ($row_rsnotifier = mysql_fetch_assoc($rsnotifier)) { $email_address = $row_rsnotifier['email_address']; $subject = 'Appointment Reminder'; $message = "<html> <head> <title>Calendar Appointment</title> </head> <body style='background-image:url(http://www.images/bkrnd.jpg); background-repeat:no-repeat; background-position:center;'> <p></p> <p></p> <p></p> <p></p> Hello, $row_rsnotifier[username] <br /> <h3>This is a friendly reminder from XYZ:</h3><br/>"; do{ if ($row_rsnotifier[nick_name] != '') $message .= "$row_rsnotifier[nick_name] is due on $row_rsnotifier[hmfollow_up_date] <hr color='#FFCE00' size='1'><br />"; } while ($row_rsnotifier = mysql_fetch_assoc($rsnotifier)); $message .='<p></p> </body> </html>'; } mysql_free_result($rsnotifier); $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: [email protected]'; mail($email_address++, $subject, $message, $headers); </code> Thank you to all in advance!
×
×
  • 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.