Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

send email when new record is added

Featured Replies

  • Newbies

I'd like to automatically send an email when a new record is entered via CWP.

Here's the situation. Student information system. Teachers can enter a discipline referral for a student via CWP, and the office needs to know that it's been entered.

How can I trigger such an email.

thanks in advance for any help or advice.

We usually have PHP run a script that creates an activity record of type email and then a server script sends the queued activity emails using 360works email.

Edited by Guest

  • Author
  • Newbies

Thanks for the reply. I don't know what you mean by an activity record of type email....

however, I have implemented a server side script that checks for new referrals hourly. Maybe that will work well enough.

Ken,

The "Send Mail" (via SMTP server) script step is server compatible; when the Teacher enters the referral, the PHP script could perform a script in the database that sends an email.

(I haven't done this, but I think that should work)

We usually have PHP run a script that creates an activity record of type email...

Out of curiosity, what other record types do you keep in the activity table? I'm surprised to hear you don't have a separate table for email records. (unless I just miss-interpreted what you were saying)

Hi. Over the years we've ended up with a table we call "Activities" in most of our systems. We also have a table of Activity Categories, ACTCATs, and each Activity record is given an ActCatID. In the ActCat table we have flag_email, flag_letter, etc.

So, when a script creates an activity record it is assigned an ActCatID. Looking thru the relationship to ActCat, each Activity knows what "type" it is. An Activity of type "email" that is queued (DateSent is empty) is found by a server script and sent. We use 360email bcs we support html, inline graphics and multiple attachments.

As for ActCat names, they are specific to the system and often mimic biz process milestones. For example, "Confirmation Sent," "Appointment Confirmed." We also have simply, "Note," a catch all Activity.

Looking at a portal of activities lets a user see the chain of events that have occurred so far for that client.

So does one table hold emails, letters, and notes? If so, do you have separate fields for each of these, or do you use any of the fields in all areas. (I can see how the field used for the message body could be the main data field for a letter or a note.)

Thanks for sharing by the way, it's always fun to hear how other people do things. It's too easy to fall into a "rut" of thinking how I do something is the only way to do it.

by the way Ken,

I think you are already using a similar method as bcooney suggested.

Yes, Dan, one table holds all emails, ltrs and notes, and the Body field is used across all types, just as you surmised. We have dedicated Email_To, Email_From and Email_ReplyTo fields.

I think the primary advantage of creating a record that IS the email that goes out, Ken, is that you retain the data in the system. If you simply find records that are in a state that "needs" an email and loop thru them sending an email without creating an email record, then there is no evidence of the email in the system. You don't need a plugin to do this, btw.

  • Author
  • Newbies

Thanks for the additional information...

I think what you have is not only a log of what happened,but the details (content) of what happened. a very nice "paper" trail.

we'll see how well this notification system works, as we are back at school today. :(

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.