This topic is locked

E-mail View Page

8/14/2007 7:36:02 PM
ASPRunnerPro General questions
A
a_melchiore author

How do you e-mail the actual view page to someone. I know how to select the record and all its fields, but I like the way view page looks. Does anyone know how would do this? This would be especial helpful if the link were active and could be clicked on and send the user back to the website in "Guest Mode".
Abel

Sergey Kornilov admin 8/15/2007

The easiest way is to send a URL of the view page.
Even if you find a way to send the whole page (i.e. using "Send page" function in Internet Explorer) images and links won't work when email is open on someone's desktop.

L
lbragg 1/14/2008

Does anyone have an example of sending and email like this where the email contains the edited record link to the view page.

I would love to see the actual code placed in asprunner's event code area.
tks

leo

Sergey Kornilov admin 1/15/2008

You can use the following approach to build a link to the View page:

strURL = "http://www.yourwebsite.com/table_name_view.asp?editid1="; & Request("editid1")
L
lbragg 1/23/2008

Here is what I found to work.
This was placed as a custom script within Before Record Update / Custom Code:
email=session("userid")

subject="Sample subject"

message="http://YOUR IP OR URL GOESHERE/YOUR TABLE NAME GOES HERE_view.asp?editid1="

message= message & GetRequestForm("editid1")

sendmail email, subject, message

BeforeEdit = True

L
lbragg 2/29/2008

Humm..... I am trying to figure out why this is not working. I had it working before in an event code Before record updated and recieved emails after a record was edited. but now I am trying to get it to work using After record is Added and to no evail. I get a email but the link is missing the "detail id" and what I would realy like to do is get a link to the mastertable list view. Is there a different coding to get a record id when adding then there is when editing?
Sample code tried:
1.)
email=session("userid")& ", rcldam@rex3.com"
subject="RCL DAM Update: Click the following link to view change request"
message="http://216.216.134.253/rcl/details_list_view.asp?editid1=";
message= message & GetRequestForm("editid1")
sendmail email, subject, message
BeforeEdit = True
This works on an edit page in events before record update. But does not work on an Add age event. I do not get the key field at the end of the link.
2.)
sendmail email, subject, message
email=session("userid")& ", rcldam@rex3.com"
subject="RCL DAM Update: Click the following link to view change request"
message="http://216.216.134.253/rcl_028_masterdetails/details_corp_list.asp?mastertable=corp&masterkey1=";
message= message & GetRequestForm("masterkey1")
sendmail email, subject, message
This was my try at getting a mastertable view page. But again I do not get the key field at the end of the link.
Any suggestions would be appreciated.
-Leo

L
lbragg 3/2/2008

'Nevermind, I figured it out. I thought I would post so anyone else looking for something like this would know how.
'place this script in events under Add page After record is added
'Change the following variables:

'1.)test@yourweb.com

'2.)text you want in subject goes here

'3.)website.com/your_table_list

'4.)tablenameherer
'Here is sample script:
email=session("userid")& ", test@yourweb.com"
subject="text you want in subject goes here"
message="http://website.com/your_table_list.asp?mastertable=tablenameherer&masterkey1="
message= message & SESSION(strTableName & "_masterkey1")
sendmail email, subject, message

S
staddeo 4/25/2009

hi leo

I am having a problem not sure what to do. The code below sends a link to the list page but how do I get it to send a link for just the record that has been added?

thanks

'Nevermind, I figured it out. I thought I would post so anyone else looking for something like this would know how.

'place this script in events under Add page After record is added
'Change the following variables:

'1.)test@yourweb.com

'2.)text you want in subject goes here

'3.)website.com/your_table_list

'4.)tablenameherer
'Here is sample script:
email=session("userid")& ", test@yourweb.com"
subject="text you want in subject goes here"
message="http://website.com/your_table_list.asp?mastertable=tablenameherer&masterkey1="
message= message & SESSION(strTableName & "_masterkey1")
sendmail email, subject, message

J
Jane 4/27/2009

Hi,
here is a sample:

message="http://website.com/your_table_view.asp?editid1="; & keys("RecordID")



where RecordID is your actual field name where primary key is stored.

S
staddeo 4/27/2009

This worked great, thanks so much.
One last question, If I wanted to combine this code with "After Record Gets Updated-Send Email with new data" how do I do that?

basically I am looking to send an email with the new record data along with a link at the bottom of the email that lets the user edit that record.
thanks

Hi,

here is a sample:
where RecordID is your actual field name where primary key is stored.

J
Jane 4/27/2009

Here is a sample:

message =""

dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next
message = message & "http://website.com/your_table_view.asp?editid1="; & keys("RecordID")