Skip to content Skip to main navigation Skip to footer

Email a Link that Generates a Document when Clicked

It is possible to email a link to your customers so they can generate a document when they click on the link. To set up this process, follow the steps outlined below.

  1. Configure a Site
  2. Configure Public Access Settings
  3. Create Sharing Rules
  4. Enable Authorization for all Opero Documents users
  5. Authorize the App
  6. Configure a Document Action
  7. Create an Email Template

Configure a Site

Go to Setup > Sites. If you don’t have a site, create one—under Sites section, click New.

  • Populate required fields, and optionally non-required.
  • For Default Web Address, leave it as it is or append a word after the slash (/).
  • Select Active Site Home Page—for default select the Opero Documents GenerateDocument page (with rsdoc namespace prefix).
  • You can leave rest of the fields as they are and click Save.

Configure Public Access Settings

  • Within the Site Details page of your site, Click Public Access Settings > Object Settings.
  • Under Apps, click Object Settings button
  • Set object-level permissions for Document Action to Read.
  • Set object-level permissions for Document Request to Read, Create.
  • Set object-level permissions for the base object that will be used to merge to Read. For example, if you’d like to use fields from the Opportunity object in your quote, set the object-level permissions to Read.
  • Set object-level permissions for any other object whose fields you want to include in your document.

Create New Sharing Rules

Document Action Object

Go to the Sharing Settings and Create new Sharing Rule for the Document Action object with these values:

  • Rule Name: e.g. External Link.
  • Rule Type: Guest user access, based on criteria.
  • Sharing criteria: e.g. Action Name not equal to “ ” (Criteria will match for all Document Actions).
  • Share with: Profile of your Guest Site User.
  • Access Level: Read Only.

Base Object for Merge (e.g. Opportunity)

Go to the Sharing Settings and Create new Sharing Rule for the base object with these values:

  • Rule Name: e.g. Opportunity External Link.
  • Rule Type: Guest user access, based on criteria.
  • Sharing criteria: e.g. Opportunity Name not equal to “ ” (Criteria will match for all Opportunities).
  • Share with: Profile of your Guest Site User.
  • Access Level: Read Only.

Enable Authorization for all Opero Documents Users

  • Go to Setup > Visualforce Pages > Administration > Preview.
  • Check the Enable Authorization for all Opero Documents users? checkbox.
  • Under Authorization User, select the user who has authorized the Opero Documents app.
  • Click Save.

Authorize the App

This step is necessary after enabling authorization for all Opero Documents users.

  • Click “Grant Access” to authorize the app.
  • Click on DocGen Configuration tab from App Launcher.
  • Grant Access to your Google Drive

These steps will enable your Site Guest User to use token of this org-wide user. For more info about authorization, refer to these articles: Basic Configuration: Getting Started and Authorize One Google Drive Org Wide.

Configure a Document Action

This is the document action that your customers will use for generating documents.

  •  Set the Redirect To field to Google Doc.
  • Depending on requirements, you can set rest of the options on Document Action (email, signature, download file…)
    • Field Update and Save URL to Salesforce Field cannot be handled because of SF restrictions for the Guest Site users.
  • For more info about Document Actions, refer to this article: Basic Configuration

Create an Email Template

This is the email template that you will use to send a document that contains the link. Within the body of the email template, include a URL to your site. To create this URL, combine the Site URL with your button code and make a minor modification to the button code in order to ensure it is sent properly.

  • Copy your site URL and paste it into the email template.
  • .Copy the button code starting at ? and paste it after the site URL
    •  e.g. SiteURL?id={!Opportunity.Id}&templateId=GDT-000000&attach=true&download=true&output=pdf, where SiteURL is a URL of the site you created and configured, and the part after the question mark (?) is copied from the document action’s Button Code (or Button Link/Code) field.
  • At the end of your button code you will see “Google Doc”. Replace space between “Google” and “Doc” with %20.

Keep in mind that this is a default configuration. You can modify this process to fit your needs, like setting a different Visualforce page as a home page, connecting it to different apex controller, configuring more document actions and email templates for different groups of customers, etc. The key point is that you must have a site which you will specify in a URL you will be sending to your customers. How will you configure email sending process (will you use different automation tools or manually), and how will you handle customers hitting your site when clicking on the link you sent them, depends completely on your business process and requirements.