Gossamer Forum
Home : Products : DBMan : Customization :

Private Email

Quote Reply
Private Email
I am trying to add the Private email mod to my dbman project and in the text file it tells me to:


###############################################################################
#file: html.pl #
# sub html_record #
# #
# Just after #
# my (%rec) = @_; #
# #
# Add #
###############################################################################

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

###############################################################################
#file: html.pl #
# sub html_record #
# #
# Add this link somewhere in the subroutine, probably close to the end. #
###############################################################################

<a href="$db_script_link_url&$db_key=$rec{$db_key}&send_email_form=1">Send email to this person</a>

This makes sense if I am not using the short vs long display mod. But since I am using the short vs long display does that mean that I am supposed to just add: $rec{$db_key} =~ s/<?.B>//g;
to only the long display?

Cher

Quote Reply
Re: Private Email In reply to
If you are just including the link to 'send email' within your long display then yes, you would include:

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

at the top of your html_record_long sub. It wouldn't hurt to include it in both subs.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Private Email In reply to
I completed the installation and now I am having another problem. When I test it and try to send an email using the form it returns with the "error" (There was a problem: There is no email address on file for this person.
Fill in your email address, the subject of your email and the message you wish to send to . )

I can't understand what could be wrong. I checked the code and it looks right but it's not picking up the record email address. Here is the code for the form page:

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

print qq|
<html><head><title>$html_title: Send an email</title></head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Send an email</b></td></tr>
<tr><td>
<p><center><$font_title><b>
Send an email
</b></font></center>

|;

if ($message) { print qq|There was a problem: $message|; }
print qq|
<$font>Fill in your email address, the subject of your email and the
message you wish to send to $rec{'Name'}.</font>
|;

print qq|
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$in{$db_key}">
<table><tr><td align=right><$font>Your email address:</font></td>
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
<tr><td align=right><$font>Subject:</font></td>
<td><input type=text name="subject" value="$in{'subject'}" size=40></td></tr>
<tr><td align=right><$font>Your message:</font></td>
<td><textarea name="emailmessage" cols=40 rows=10>$in{'emailmessage'}</TEXTAREA></td></tr>
</table>
<center>
<INPUT TYPE="SUBMIT" NAME="send_email" VALUE="Send Email">
<INPUT TYPE="RESET" VALUE="Reset Form">
</center>
</form>
|;

&html_footer;
print qq|</td></tr></table></body></html>|;
}

Thanks so much!



Cher
Quote Reply
Re: Private Email In reply to
I really need someones help for this...Isn't there anyone out there who could spare a few moments?



Cher