Here i want share about how to send document link to mail by document universal id.
Step 1: Create one document for send mail and add the following necessary fields: Form, From, Memo, SendTo and Subject.
Step 2: Save the data source and then get that universal id of that document
Step 3: finally add this id to body.
var Sender=”Ram Kumar”;
var Receiver=”kramkumar.mca@gmail.com”
var Subject;
var DocUNID = LeaveRequest.getDocument().getUniversalID();
var SendingxPage = “LeaveRequest.xsp”;
mailDoc=database.createDocument();
mailDoc.appendItemValue(”Form”,”Memo”);
mailDoc.appendItemValue(”From”,Sender);
Subject=” To be Approved”;
mailDoc.appendItemValue(”Subject”,Subject);
var rtItem=mailDoc.createRichTextItem(”Body”);
var serverName=session.getServerName();
var DBPath=session.getDatabase();
var dbFullAddressNotes = serverName + “/” + DBPath;
rtItem.appendText (”Hi “+Receiver+”,”)
rtItem.addNewLine(2)
rtItem.addTab (1)
//On Notes var url=”notes://”+dbFullAddressNotes+”/”+LRxPage+ “?OpenXPage&documentId=”+DocUNID+ “&action=editDocument”;
//On Web Browser var weburl=”http://”+ serverName +”.maargasystems.local”+”/”+DBPath+” /”+SendingXPage+ “?OpenXPage&documentId=”+LRUNID+ “&action=editDocument”;
rtItem.appendText(” Please click on the below link to approve my request:”)
rtItem.addNewLine(1)
rtItem.appendText(”On Notes: “+url)
rtItem.addNewLine(1)
rtItem.appendText(”On Browser “+weburl)
rtItem.update()
mailDoc.appendItemValue(”SendTo”,Receiver);
mailDoc.send(false)
No comments:
Post a Comment