Can I get an html page and then mail it, all from the browser?

I have an nsf full of documents. These documents are being created through the Notes client and viewed (not edited) through Domino http. The documents may have images and attachments. The sole browser in use is MSIE.

I need the browser user to be able to mail a given document to other people. Generally those other people will be Notes users within the company. What is the best way to do this?

The approach we have tried so far is to submit the list of names to the Notes server and have it mail the document. That approach probably will work but is proving a little more difficult than expected. My question is, is there away to have the user’s browser send the HTML document it already has*, as opposed to making a trip back to the Notes server to have it mail the original Notes document?

  • These docs are created with the browser in mind and the form contains passthrough html

Subject: Can I get an html page and then mail it, all from the browser?

Why send the document when you can send a link? Just askin’. Sending HTML to Notes users is limited at best, even with the improvement in Notes 6.5.4; it’s far better to let them see it in a browser.

Subject: RE: Can I get an html page and then mail it, all from the browser?

Why send the document when you can send a link?

Great question. Probably because the documents are in a newsfeed application they would prefer to keep off everyone’s desktop.

Invoking an api call to mail the current page, as Simon suggested, is probably best. I haven’t found the method for that yet.

But I had another idea. The documents are in Notes; they are being viewed in IE; 95% of the documents look fine in Notes and could be mailed as is; the remaining 5% usually have square-bracketed passthrough that doesn’t wotk in notes. So I’m going to try the following:

  1. Put an agent in the newsfeed nsf.

  2. Submit the document unid and send-to names to the agent through http.

  3. The agent locates the document.

  4. The agent checks whether the body contains anything like “[ <” etc.

  5. If no. the agent changes the form to Memo and mails the document .

  6. If yes, the agent obtains the same document from localhost via .getdocumentbyurl, and mails that.

The idea is that if the document contains passthrough the recipient will receive in their (almost always Notes) mailbox the same html page the sender saw on the intranet, otherwise they receive the body of the original notes doc. We’ll see if that works.

Subject: RE: Can I get an html page and then mail it, all from the browser?

Not a Notes document link – a URL link. The object of the game is to get the users looking at the HTML, right? If you send a URL link, the users will not get a workspace link, and most of them will not be aware that the server is Domino. And if the URL begins with http://, they will be looking at the page with a browser – whether that be a separate web browser application or the IE control built into Notes. Either way, it’s going to happen with full fidelity.

Building the link is simple enough; you merely need to get window.location.href into the email generator, whether that be by posting as a field value or appending to an agent URL in a GET call.

Subject: RE: Can I get an html page and then mail it, all from the browser?

The object of the game is to get the users looking at the HTML, right?

Not if it can be avoided. They want to ‘mail the current page’ to x number of people. To my way of thinking, the original docs are in Notes, almost all of them look fine in Notes, so I would prefer to mail the (Body field of the) original document and not its html analog.

I don’t know of a way to get the browser to do that.

So I loaded the WEB task on our development server and tried invoking an agent, passing it the unid of the document I want mailed. The agent then does one of two things:

  • it mails the document as-is if it appears to contain no passthrough html (this works)

  • obtains the same document from localhost using .getdocumentbyurl. (this does not work)

The idea is, if the document contains passthrough html the recipient gets html, otherwise they get notes rich text.

But all I get back from the agent in that latter case is a note saying I’m not authenticated. I tried fiddling with the various arguments etc.

Can you tell me how to get .getdocumentbyurl to work from the server?

Subject: RE: Can I get an html page and then mail it, all from the browser?

Now you are confusing matter, it seems to me. If the document looks good in Notes, why would you want to translate it to the web before translating it back to Notes. If a book sounds good in English, don’t translate it to French and then back before people read it. They won’t approve of the results, trust me. Let the server send the original Notes document and your users will be much happier.

Subject: RE: Can I get an html page and then mail it, all from the browser?

why would you want to translate it to the web before translating it back to
Notes.

I will try to explain.

At present all the documents are being viewed solely through IE. Thus, some of
them contain square-bracket passthrough. (The editors probably do not know how
to do hotspots.) Now they want to click a browser link and mail that
document/page to someone.

I think it would be better to email the Notes document instead, except in
certain cases where the document isn’t formatted to work correctly in notes.
For example the document may contain several of these:

a href=something>Some site]

Those documents I want to send as html; everything else should go as-is just by
setting the form to Memo and calling Send.

Of course they could just mail the http url with a comment to the effect of
‘please look at this’ but that’s not what they want, they want to mail the
whole page. Mailing a link back to the Notes nsf is also out as they don’t
anyone going in there.

The simple and I think most efficient thing to do is have a Notes agent mail
the document on demand. That’s easy, but to make the passthrough-containing
documents work properly I need them converted to html by the agent. The agent
can identify these more or less reliably by looking for the square bracket
pattern.

The effect should be as if some documents were mailed from the browser and
others from Notes.

That’s why I’m trying to use getdocumentbyurl.

Subject: RE: Can I get an html page and then mail it, all from the browser?

So, what you have is a book that reads well in English, but only if you also know French, because there are whole paragraphs in French scattered through the book. This is a lot harder to judge. Perhaps you could send the document through the mail but ask them to view it through iNotes? Nah, that’s not going to work.

I still think you probably need to have them send the Notes document, but I can also see that there are reasons to send the HTML.

Subject: Can I get an html page and then mail it, all from the browser?

Since you say your users are all using IE, you can tell them to use IE’s menu bar option: File > Send > Page by Email.

Test this first though - depending on how you’ve formatted your HTML pages they can get screwed - especially if you use stylesheets.