Gossamer Forum
Home : Products : DBMan : Customization :

record validation, notification, and emailing

Quote Reply
record validation, notification, and emailing
Hello,

I have a question if the following exists.

I have a database where individuals can sign up and upload an image (got that down).
I am looking for a way, once the record is added, for the admin to be emailed that a record has been added, be able to go to the admin panel and either approve or reject the record, and in either case can send out the approiate email to the individual.

Is this possible?

Thank you very much!!
Quote Reply
Re: record validation, notification, and emailing In reply to
Carol, as it seems you are either a mind reader or very used to people like me. In either case thank you.

I am perl dabbler, but new to dbman. I attempted to use the code, but ....well my lack of dbman knowedge and limted perl turned out to be a stumbling block.

Her though is what I am looking to do:

Have it such that when a person comes to the site to add there info to the database they can register for a password and enter their information into dbman.

Upon submitting the info an email gets sent to the site admin, alerting them of the record entered. The admin can then go to the dbman admin panel and approve of reject the record. If approved an email is sent to the registrant alerting them or reject an alternate email sent saying the latter.

I am currently using the image upload mod, short to long mod, and private email mod, if that means anything.

Again, thank you for any assistance.

PS I saw your site and it is a great resource. I do hope that my knowledge of dbman increases so I may pitch in a word as opposed to asking for them.
Quote Reply
Re: record validation, notification, and emailing In reply to
Look here,
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000660.html,
I will try to setup this mod after my 'file-upload' mod works, so good luck.

--------
Mart.
Quote Reply
Re: record validation, notification, and emailing In reply to
It is a bit tricky to install...But works like a charm!

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: record validation, notification, and emailing In reply to
I shall give it a try.
Thank you so much!!
Quote Reply
Re: record validation, notification, and emailing In reply to
Understand that I wrote that thread to Eliot, knowing that he had some understanding of Perl and DBMan. Also, he had previously asked me not to give him all the code for things, but rather to point him in the right direction so he would learn how to do some programming.

If you have any problems, let me know. Also, be as explicit as you can about what you want the validation routine to do. As you can see in the other thread, there are a number of different things people might want to implement and the code is different for each one -- which is why I haven't made a mod for it.


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
Thank you for the kind words about my site. I'm hoping that it will be helpful.

If you keep working with DBMan, you will be able to start answering questions yourself. Smile

My validation routine does not work through the admin panel, but through a link that is only displayed when someone with admin permission logs on. (I'm sure that won't make a lot of difference, but I just want to be clear.)

The big question I have to ask now is whether you want to be able to edit the email going out to those whose records are validated or rejected. That makes a huge difference in the code.

If you want to send out "canned" email to both, you can just select either "validate" or "delete" for each record, click one button and the script will do the rest.

If you want to be able to edit the email going out, you'll have to validate or delete each record separately.

I just hate to paste code onto the forum and then be told "but I want something different." I'm afraid it's happened a lot of times and I'm doing my best to avoid it.


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
That canned email idea sounds great. The less the admin has to do and the more the script can do, the better.

I agree with your desire to not make this forum a venue for pasting miles of code.

I also appreciate you help!!

As for your site, Helpful is actually an understatement. It is actually a testiment to "The right way of doing it"!! I have pooled through pages, just learning more. :-)

Thank you!!!!
Quote Reply
Re: record validation, notification, and emailing In reply to
Cool. That's the easiest one to do. Smile

It seems that there is a limit to the amount of text I'm able to place in my reply. I've made up a text file with the instructions which is at

http://www.jpdeni.com/...n/Mods/validate1.txt

For anyone else using this, the mod is set up for those who are also using the short/long display mod. If you are not using the short/long display mod, the subroutines for the html.pl file will be incorrect.


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
I just realized that you also asked about mailing the admin when a record is added.

There's been a lot of discussion about that. I'll see if I can find the most recent one that includes code.


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
WOW!!! Thank you.

I will plug it into the script and tell you how it goes.

Thank you sooooooo much!! :-)

Michael
Quote Reply
Re: record validation, notification, and emailing In reply to
Please do. I did check it for syntax errors, but you never know what sort of mistakes I might have made.

I found one place with a "notify" routine, but it's for after a record is modified. You would just need to move the code from html_modify_success to html_add_success.

It's at

http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000759.html


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
Hi Carol,

Well I placed the mod in. :-)
There are no syntax errors, it displays the proper functions (validate delete), but it appears that adding a record does not trigger an email to the admin, nor listing new records for validation on the admin interface. It does list records, but I do not know how it is choosing them. As well, upon validaion, no email is sent out to the user.

Quote:
I found one place with a "notify" routine, but it's for after a record is modified. You would just need to move the code from html_modify_success to html_add_success.

I am not sure if it is related to what you said above, I was little unclear on what you meant.

BTW: The mod was simple to install.

Thank you!!
Quote Reply
Re: record validation, notification, and emailing In reply to
Well, the mod does not include sending email when a record is added. I had forgotten that you wanted it and it really isn't part of the validation routine anyway.

To get email sent to you when a record is added, add the following to the beginning of sub html_add_success:

Code:
%rec = &get_record($in{$db_key});
open (MAIL, "$mailprog") or &cgierr("Can't open sendmail!\n");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Record Added\n\n";
print MAIL "A new record was added with the following key value:\n";
print MAIL "$rec{$db_key}\n\n";
close (MAIL);

Code:
print qq!| <A HREF="$db_script_link_url&validate_form=1">Validate</A> ! if ($per_admin);

Quote:
It does list records, but I do not know how
it is choosing them.

It should be choosing them on the basis of the value of the Validated field.

Quote:
As well, upon validaion, no email is sent out to the user.

Are you sure that your path to sendmail is correct?

Try adding the code above -- the one that sends you an email when a record is added. That will give you an idea of whether your setting for sendmail is correct.



------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
Hi Carol,

Well I added the code.
Everything seems to working fine, but no emails being sent at all ( have looked for errors, as best I can but I can not see any. The path to sendamil is correct, because the send private email mode is working fine.

The other thing I noticed is that when the short list comes up of records to validate, it does not have a way to validate large list of records (i.e., 20 records show, but ther may be 40, therefore when I validate and then refresh, another group of records shows up).

I do have to say this, I am getting much more aquainted with the code :-)

Thank you!! :-)
Quote Reply
Re: record validation, notification, and emailing In reply to
So you're not getting any mail after a record is added either?

If you want to have more records come up on the validate list at a time, add

$in{'mh'} = 100;

just after

$in{'Validated'} = "No";

in sub html_validate_form.

That will give you 100 to a page. If that's not enough, change it to 1000.


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
I am not getting the records mailed, but pooling over the code I love the knowledge I am getting. I even saw the part of the code to increase the list size like you said. :-)

I have no clue what I am doing wrong to not have the mail go out, but I am searching for the asnwer.

Thank you so much for all your help on this. I guess I never quite realized how pwerful this script is. WOW!!

Now on to find out the email glitch.
Quote Reply
Re: record validation, notification, and emailing In reply to
Now the time has come, as it comes for most folks who have problems with their scripts, for you to let me look at your file. Smile

I need you to copy your html.pl file to a web-accessible directory -- one where you would place html files -- and rename the file to html_pl.txt. Then come back and tell me where I can look at it. Might be a good idea to also post your default.cfg file, too. Just change the name so it has a .txt extension on it.

If, for security reasons, you don't want to post your files publicly, you can send me the URL of the files to hall@drizzle.com.

It is fun to play with the script, isn't it? The possibilities are limitless!


------------------
JPD





Quote Reply
Re: record validation, notification, and emailing In reply to
Hi,

I shall email you there location. Thank you!.
These program is unreal and I wish I would have discovered its power long before. But now I have :-)

Quote Reply
Re: record validation, notification, and emailing In reply to
Kudos to Carol!!

Thank you so much for your help and pointing me in the direction of knowledge.

I am sure I will have questions in the future, but you have opened the door of this script to me.

The mod is great as are you!!
Quote Reply
Re: record validation, notification, and emailing In reply to
Hi JPD!
did you by any chance make these changes to your validate script any where? I just downloaded the validate1.txt from your site and added all the mods, but I'm having the same probs...

I know it is what has been spoken about here, but as MJ had to email you his files, did you work out if there was something mising in the script? I presume all the other bits work, but I don't want to get to the same stage then have to ask you to fix the same bug for me!

thanks! This is kind of a perverse pleasure delving into the scripts like this! I don't know much about them but I'm learning extremely quick (you are a very good teacher!!)



------------------
Ben

-------------------------
http:/www.t-e.co.uk

Quote Reply
Re: record validation, notification, and emailing In reply to
I'm really happy to teach you about all this, but sometimes I get a bit confused in a long thread. Why don't you start a new topic and let me know exactly what problems you're having and we'll start from there.



------------------
JPD