Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6379139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:05:57+00:00 2026-05-25T02:05:57+00:00

I would like to create a user notification system using emails. In context it

  • 0

I would like to create a user notification system using emails.

In context it is for employees (user type 1) to log onto my system and enter their timesheet (hours they’ve worked). I would like a notification to be sent to their supervisors (also members of the 'users' table (user type 2) that they have entered the information and it is ready to be checked.

Currently I have a database with a table 'users' which stores information such as 'id' (PRIMARY) AUTO INCREMENTING, 'first_name', 'last_name', 'email', 'user_type', etc.

I know how to sent emails in PHP, and I have a fully functioning log in system however it is these notifications which I cannot get my head around with how to implement.

My current code is not Object-Oriented as it is beyond my skill level at this time.

I would like something simple, it doesn’t have to be perfect. Any suggestions are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:05:57+00:00Added an answer on May 25, 2026 at 2:05 am

    When an employee successfully enters a timesheet, can you not fetch the list of users and then send them all an e-mail? I’m guessing the timesheet is a web form, so just trigger some code when the form gets submitted.

    For example:

    <?php
        foreach($supervisor_user as $su) {
            mail(...);
        }
    ?>
    

    However, what might be nicer, is to periodically check (by using a cronjob) for new timesheets and then e-mail all the supervisors about any new time sheets.

    I won’t write the full PHP for this, it’s more of a pseudocode outline:

    <?php
    
        $last_check = /* Fetch the time we last checked for timesheets */
        $new_timesheets = /* Fetch all timesheets submitted after this time */
    
        /* Construct the e-mail message */
        $message = "Hello, here are the new timesheets. \n";
        foreach($new_timesheets as $ts) {
            $message .= "* $ts \n";
        }
    
        /* Send a message to all supervisors */
        $supervisors = /* Fetch e-mails of all supervisors */
        foreach($supervisors as $s) {
            mail(...);
        }
    
        /* Finally, store the time we last checked for timesheets
           so that we can use this on the next run. */
    
    ?>
    

    You might then set that to run every day, meaning that supervisors would get a single summary e-mail every day, rather than being bombarded with an e-mail for every submitted timesheet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a form where a user can enter an arbitrary
I would like to create model binding functionality so a user can enter ','
I would like to create a notification that clears automatically when the user presses
I would like to create a user interface like the iGoogle or facebook profiles
I would like to create the ASP.NET User database template on a database of
I would like to use create a rails route for a user's open id.
I am trying to create a winForms user control. But I want would like
I would like to create a mechanism for a User to keep track of
I would like create a very simple Paint application using MAF on WPF. The
I would like to create a user interface which would contain network indication icons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.