Gossamer Forum
Home : Products : DBMan : Customization :

Email on field change

Quote Reply
Email on field change
I have a database in which there is a Status field. What I would like to do is send out an email if the status of a record changes. The email mod is no problem. But, I'm stuck on how to compare the information in the form to the information in the database.
For example, let's say a record is currenlty Unapproved in the Status field. Then someone modifies it and it changes to Approved, and an email is sent. Then someone modifies the record again, without changing the status and no email is sent because one has already been sent.
Is this possible and if so how can I implement this?
Quote Reply
Re: Email on field change In reply to
Check out this Thread:

http://www.gossamer-threads.com/...m12/HTML/000636.html

It works very well and I think fits your needs.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Email on field change In reply to
Hmm... Well I read the post but I'm not sure that I understand. It never really explained how to implement this. I would prefer a method that compares the information in the modify form to the information in the database and if the field has changed send an email. But, I guess a change box checked would work, if it automatically reset after sending the email.
Quote Reply
Re: Email on field change In reply to
Yes...The field is not written to the database and resets after you modify the record. We are using this for our Server User Account Directory. When I change a password on the server, I go into the database program, put in the new password and also click on the Change checkbox, which sends an email to the user to notify them that their password has been updated and now they can access their account.

You can also change the SMTP/Sendmail configurations to send an email to one user rather than the Record Owner.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 11, 1999).]
Quote Reply
Re: Email on field change In reply to
Hey,
Thanks Eliot. That worked. I finally got around to trying it and that was almost exactly what I needed. Its not quite automatic enough, but that's ok I'm willing to live with it.
Quote Reply
Re: Email on field change In reply to
I don't know how more automatic to make it.
How more automatic would you like to have it? Give us some ideas and we may be able to improve that mod.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Email on field change In reply to
What I had originally wanted was something that compared the new information being entered into the modify form to the information in that field in the default.db file. And, then if the information on the form was new it would send out an email. However, this may be way too complicated.
Quote Reply
Re: Email on field change In reply to
I like challenges! Smile While I may not be able to come up with the enhancement by myself, I think that I can start on something that may enhance my original suggestion and at the same accomodate you better. Smile

It will take me a bit...but I am starting to see some codes that could possibly be used. It is easy to incorporate a sendmail routine that automatically sends out an email everytime a record is modified.

The tricky part I am thinking about is with your following request:

Quote:
Then someone modifies the record again, without changing the status and no email is sent because one has already been sent.

That part alluded me to the mod that I gave you because it does not send out an email everytime, only when that field (checkbox) is clicked on.

Let me think about this for a day or so and see if I can come up with something. I am working on another stand alone email script that I am using for mass mailings from the DBMAN database file. So, when I get a chance I will re-visit this issue.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Email on field change In reply to
Thanks. Like you, that is the same place I got stuck. However, the checkbox method is currently working so thanks for that suggestion.