Gossamer Forum
Home : Products : DBMan : Customization :

webmailer question

Quote Reply
webmailer question
Can somebody solve my problem? I would like webmailer to search a field in a database rather than automatically send email to the users of a particular field. What I ultimately want is a field for college year information (freshman, sophomore...) and then be able to send email only to freshman. I would rather not have users select a radio box to indicate their college year information because that would require 4 fields. Besides that, I would like to use it for other applications that require many more than 4 answers.

Can somebody offer guidance? I have webmailer working fine but want refinement.

Thanks,
Chris
Quote Reply
Re: webmailer question In reply to
Well one thing I guess you could do is make it a drop down option list. then from there, in your success_sub part,
Code:
if (rec${'grade'} eq "Sophmore"){
open (MAIL, "$mailprog") or &cgierr("unable to open mail program");
print MAIL "To: $db_userid\n";
print MAIL "From: Database\n";
print MAIL "Subject: Attn sophmores\n";
print MAIL "-" x 75 . "\n\n";
-----put your info here -------
close (MAIL);
}
}
else {
}


If you were looking to do it as they filled in the form, that's a start anyway, as for doing a mass mailing every now and then...... well that I have no clue where to start Smile

------------------
Conor Treacy
www.handsonwebdesign.com



[This message has been edited by Leprechaun (edited March 22, 2000).]
Quote Reply
Re: webmailer question In reply to
Thanks Leprechaun! I don't really want to do the mailing as they enter records. I just want to be able to send a mass email to users that can be searched for in a field. I appreciate your response and will give it a try to see how it works. I would still like other ideas if anybody has them.

Thanks,
Chris
Quote Reply
Re: webmailer question In reply to
I haven't had a chance to look at the webmailer script as yet. I'm sure it can be modified to do what you want.


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





Quote Reply
Re: webmailer question In reply to
I've looked over the script and I'm sure it can be used for what you want. Have you installed Eliot's webmailer?


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





Quote Reply
Re: webmailer question In reply to
Hi JPDeni,

Yes, I have Eliot's webmailer installed and working fine. Thanks for your help. Anything I can do?

Chris
Quote Reply
Re: webmailer question In reply to
Sure. It shouldn't be too hard. But I've been up all night. I'll have to get back to you after I've had a little snooze. Smile


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





Quote Reply
Re: webmailer question In reply to
Okay. I got some sleep and I'm rarin' to go! Smile

In webmailer.cfg, add a line to give the field position of the "year" field in your database. Let's call it

$year_field

You can put it anywhere in the .cfg file. Use the $mailfield line as a pattern for syntax.

In webmailer.cgi, sub form2, add either a select field or radio buttons so you can select the year you want. Be sure that the values of these match values that will be in your database. Give the name year to your input field.

In sub mailing, change

Code:
if (($data[$mailfield]) and ($data[$confirmfield] eq 'Yes')) {
push (@emails,$data[$mailfield]);
push (@confirm,$data[$confirmfield]);
}

to

Code:
if (($data[$mailfield]) and ($data[$confirmfield] eq 'Yes')) {
if ($INPUT{'year'} eq $data[$year_field]) {
push (@emails,$data[$mailfield]);
push (@confirm,$data[$confirmfield]);
}
}

That should do it. Of course, I haven't been able to test it, but it seems like it would work.


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





Quote Reply
Re: webmailer question In reply to
Thanks for the help. I haven't done it yet but will be able to free up some time either this afternoon or tomorrow. I will keep you posted. Did anybody else try it?

Chris
Quote Reply
Re: webmailer question In reply to
Actually, many of the codes in the script were originally written by JPDeni...

The Mod is not very hard to modify.

The nested conditional statements that JPDeni should work just fine.

Thank you, Carol, for providing those codes. (I know that others have requested this before...but I have not had time to test modifications to the Webmailer Mod.)

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums