This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 18, 2012, 4:32 AM
3 Posts

Mail Send

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: mail send,document id,universal id.
  • Replies: 3
 Hi All, I am totally new to notes, and now working with X-pages,
I need to implement the following. 
In an application, on a submit button, the document should save, and a mail (In body:url containg document id, so the user can open the document from mail only)should trigger. The mail should trigger to group of users who are listed  in listbox. 
Can anyone tell me how can I achive this. 
please do help me. 
 
Thanks in Advanced 
Aug 2, 2012, 5:43 AM
26 Posts
Re: Mail Send
Here is the code with SSJS:
 
//Create new mail document
var memo:NotesDocument = database.createDocument()
    memo.replaceItemValue("Form","Memo");
    memo.replaceItemValue("Principal",Sender_name);
    mailSubject=PersonNm + " " +  mailDoc.getItemValueString("subject")
 
//Append  data from existing body field on the form.
    memo.replaceItemValue("Subject", mailSubject);
    var Body_MailDoc:NotesRichTextItem = mailDoc.getFirstItem("body")
    var Body_Memo:NotesRichTextItem = memo.createRichTextItem("Body")
    Body_Memo.appendRTItem(Body_MailDoc)
    Body_Memo.addNewLine(2);
 

     //GET THE SERVER NAME TO APPEND IN THE DOC URL
     var serverName:NotesName = session.createName(db.getServer());
     var strReplace = db;
     strReplace = @ReplaceSubstring(strReplace,"\\","/");
    
 //URL Construction using the Universal ID of the document
     var url:String = "http://"+serverName.getCommon()+"/"+strReplace+"/"+"Name of xpage.xsp?documentId="+@Text(docID) +"&action=editDocument"
    Body_Memo.addNewLine();
      Body_Memo.appendText(url)

      memo.replaceItemValue("CopyTo",Cpyto);
      memo.send(sendTo)
 
Hope this helps!!!
Regards,
Pranesh Vaidya
 
 
Nov 8, 2012, 7:07 AM
3 Posts
Re: Mail Send
I am able to send mail, but the issue is the URL which we append in body is simple a string, I want it to be hyperlink
so the approve should click the link from inside their mail.
 
Thanks 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal