Gossamer Forum
Home : Products : DBMan : Customization :

Only some fields in Forward Record Mod

Quote Reply
Only some fields in Forward Record Mod
Hi.

I'm using the Forward Record Mod by JPDeni. Currently ALL the fields in the record is included in the email and textfield. Some fields in the records is for internal use only and I don't whant them sent out to everyone.

How can I specify which filds will be sent?

The ultimate sloution would be that the visitors get an empty textfield for his personal message. The email will then contain his message at the top, and the fields I specify at the bottom.

Any thought on this? I'm no expert at Perl so please be nice!

Best, Stian


Quote Reply
Re: Only some fields in Forward Record Mod In reply to
Please visit the FAQ noted below and look under the section "Email". There are several references of how to just select specific fields to send with your email

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Only some fields in Forward Record Mod In reply to
hi stiantot,

i just added the Forward record and have the same question !
i just realized maybe the answer comes from this line;
$rec{$db_key} =~ s/<?.B>//g;

my assumption is it should be the one i've got already on sub_html_record quite similar but not exactly;

$rec{$db_key} =~ s/<.?B>//g;

well we'll know pretty soon if anyone has had the same thing!!

i went thru the FAQ of loisC none has the same exact question

cheersSmile
macagy


Quote Reply
Re: Only some fields in Forward Record Mod In reply to
no luck ;
i tried to do without

$rec{$db_key} =~ s/<?.B>//g;

it just didn't do the trick!!!

not too many customers on that one!!!!

keep smilingSmile
macagy

Quote Reply
Re: Only some fields in Forward Record Mod In reply to
Hi everyone;

here the piece of code from where i think the error comes: can you help me detect it

sub html_forward_email_form {
#----------------------------------------------------------
my ($message) = $_[0];
$in{$db_key} =~ s/<?.B>//g;
%rec = &get_record($in{$db_key});

unless ($in{'email_message'}) {
foreach $col (@db_cols) {

$in{'email_message'} .= qq|
Hi, there.

I just wanted you to know that.....
|;

------------------------------
this message prints as many times as the fieldnames i've got on the Add_Record

thank you for your help

cheersSmile
macagy



Quote Reply
Re: [macagy] Only some fields in Forward Record Mod In reply to
Hi macagy,

Did you find out how to hide fields you dont want to show in the "forward record mod?
Quote Reply
Re: [jamaicasearch41] Only some fields in Forward Record Mod In reply to
The solution is contained within the thread called "Forward Record MOD Fix"


To add your own field list instead of code:

unless ($in{'emailmessage'}) {
foreach $col (@db_cols) {
$in{'emailmessage'} .= "$col: $rec{$col}\n";
}
}

List the fields you want to include using the following code.

unless ($in{'emailmessage'}) {
$in{'emailmessage'} .= "Title: $rec{'Title'}\n";
$in{'emailmessage'} .= "Date: $rec{'Date'}\n";
}

The \n part of the line gives you a linebreak in the textarea field. Notice the use of .=.
This causes the text that your adding to be added to the end of whatever was previously in the variable.


When I use this mod I put add the fields i want to send right into this section:

open (MAIL, "$mailprog") || &cgierr("unable to open mail program");
print MAIL "To: $in{'to_email'}\n";
print MAIL "From: $in{'email'}\n";
print MAIL "Subject: $in{'subject'}\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL $in{'emailmessage'};
print MAIL "\nRecord Details:";
print MAIL "Title: $rec{'Title'}\n";
print MAIL "Date: $rec{'Date'}\n";

close (MAIL);
&html_forward_email_success;
}

---------------------------------------

Please also note the fixes mentioned in that thread:


sub html_forward_email_form {
#--------------------------------------------
my ($message) = $_[0];
$in{$db_key} =~ s/<?.B>//g;
%rec = &get_record($in{$db_key});

Replace: unless ($in{'email_message'}) {
with: unless ($in{'emailmessage'}) {

foreach $col (@db_cols) {

Replace: $in{'email_message'} .= "$col: $rec{$col}\n";
with: $in{'emailmessage'} .= "$col: $rec{$col}\n";

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/

Last edited by:

LoisC: Apr 7, 2005, 8:19 AM