What it does

This Add-In emails someone outside DocMgt a link to the Document open in the viewer. They click the link and see the Document without signing in or needing an account. A second Add-In revokes the link when they no longer need it. Use it to send a single Document, such as a contract or a statement, without setting up a portal.


Before you start

Document sharing has to be turned on for the Record Type. Open the Record Type in administration and turn on Document Sharing. Without it, the Add-In stops with a "Doc Sharing Not Enabled in Record Type" error.


The Share Add-In

Settings

  1. Create a new Add-In and name it something like Email Document Link.
  2. Under General Settings, set Type to Actions Only.
  3. Under Where/When to Show, turn on the Record location, use Record Types to limit it to the Record Types that allow sharing, and leave the option set to Add-In will have OPENED Document available to it.
  4. Under Data Entry Options, click Add Prompt Value and set Field Name to a field for the recipient's address, such as ShareEmail. The address the user types is saved to that field before the actions run.
  5. Under Confirmation Prompt, add a message such as "Email a link to this Document? Anyone with the link can open it."


Actions

Add these actions under Record Actions, in this order.


1. Create Document Share

  • Turn Active Document on, so the Document open in the viewer is the one shared. With it off, the action shares the first Document that matches Documents to Share, which may not be the one the user is looking at.
  • In Expires, enter a date after which the link stops working, such as [DATEADD([DATE]|0|0|14)] for two weeks from today. Leave it blank for a link that does not expire.
  • Enter a Password if the recipient should need one to open the Document. Send the password to them separately, not in the same email.
  • Turn on Log Access to record each time the link is opened.
  • In Notification Emails, enter addresses that should get an email each time the link is opened, such as [USEREMAIL] to tell the user who shared it. Separate several addresses with ;.
  • In URL(s) to Field, enter a field to hold the link, such as ShareLink. The next action reads the link from this field.


2. Send Email

Click Edit Details. On the Addressing tab, set Email To to [ShareEmail]. On the Content tab, enter a subject and a body that includes the link, for example:

Please use the link below to view [DOCUMENTNAME]. The link expires in two weeks.


[ShareLink]


3. Add Record Note (optional)

Add a note such as "Link to [DOCUMENTNAME] emailed to [ShareEmail] by [USERFULLNAME]" to keep a record of what was shared and with whom.


The Revoke Add-In

Create a second Add-In named something like Revoke Document Links, set up the same way but without the prompt value, and with a confirmation such as "Stop all links to this Document from working?"


Under Record Actions, add an Expire/Update Document Share action:

  • Leave Share Name or URL blank, so every link to the Document is revoked, not just the most recent one.
  • Turn Active Document on, so it revokes the links to the Document open in the viewer.
  • Set Operation to Expire Now.


Using it

Open the Record, open the Document in the viewer, and click Email Document Link. Enter the recipient's email address and click Save. The recipient receives an email with the link. To stop the link working early, open the same Document and click Revoke Document Links.


Notes

  • Anyone who has the link can open the Document until it expires or is revoked, so share only what you would be comfortable sending as an attachment.
  • Each time the Share Add-In runs it makes a new link. Earlier links keep working until they expire or are revoked, and the ShareLink field holds only the newest one. That is why the Revoke Add-In leaves Share Name or URL blank.
  • If the Revoke Add-In is run with no Document open in the viewer, it revokes the links to every Document on the Record.
  • E-forms cannot be shared this way.
  • To change a link's expiry date instead of ending it, set Operation to Set Expire Date and enter the date in New Expire Date.