What it does

This Add-In builds a document from a Word merge template, saves it to the Record as a PDF, and emails it. Use it for quotes, letters, statements, or any document you send to a customer or vendor from Record data. You can keep the PDF on the Record as a copy of what was sent, or have the Add-In delete it once the email has gone out.


Settings

  1. Create a new Add-In and name it something like Email Quote.
  2. Under General Settings, set Type to Actions Only.
  3. Under Where/When to Show, turn on the Record location, and use Record Types to limit it to the Record Types the merge template was built for. Turn on the Search location as well if you want to send to many Records at once from search results; the actions then run once for each Record.
  4. Set the option to Add-In will refresh the Record/Viewer screen after running, so the new PDF shows on the Record when the Add-In finishes.
  5. Under Confirmation Prompt, add a short message such as "Email this quote to [CustomerEmail]?" so the user can see who it is going to before it is sent.


Actions

Add these actions under Record Actions, in this order. The document has to exist before the email can attach it, and the email has to be sent before the document is deleted.


1. Merge Document Template

On the Merge tab:

  • Choose the Word merge template.
  • Fill in the Category, SubCategory, and Name to save the merged document under, such as Correspondence, Quotes, and Quote. Any of the three left blank is taken from the merge template itself. Choose values that no other Document on the Record uses, because the next two actions find the PDF by these three values.


On the Options tab:

  • Turn on Convert to PDF, so the merged Word document is saved as a PDF.
  • Turn on Compress PDF Output if the document has large images and you want a smaller attachment.
  • Turn on Overwrite Document if you are keeping the PDF. Sending again then replaces the earlier PDF instead of adding another copy.


2. Send Email

Click Edit Details to set up the email.

On the Addressing tab, enter the recipient in Email To, usually a field that holds the address, such as [CustomerEmail]. Enter one address or field per line. Add Email CC or Email BCC addresses if needed, for example [USEREMAIL] to copy the user who sent it.

On the Content tab, enter the Email Subject and Email Body. Both can contain variables, such as Your quote [QuoteNumber] for [CustomerName].

On the Attachments tab, click Add Attachment and enter the same Category, SubCategory, and Name you used in the Merge Document Template action. Leave the file name blank to use the Document's own file name, or enter one such as Quote [QuoteNumber].pdf. Set the attachment to Attachment Only.


3. Delete/Purge Document(s) (optional)

Add this action only if you do not want to keep the PDF on the Record.

  • Enter the same Category, SubCategory, and Name again under Delete Documents, and leave Record ID and Document ID blank.
  • Leave Delete/Purge set to DELETE. A deleted Document can still be restored from the Record's Document list if you need it later. PURGE removes it permanently.
  • Turn Delete All on if earlier runs may have left more than one copy behind.


Fill in all three of Category, SubCategory, and Name. Any of them left blank matches every Document, so a blank Delete Documents row would delete the first Document on the Record, whatever it is.


Using it

Open the Record and click Email Quote. Confirm the prompt. The PDF is built, emailed, and then either kept on the Record or deleted, depending on how you set the Add-In up. Try it first on a test Record with your own email address in the address field, and check the attachment before sending to anyone else.


Notes

  • The PDF is attached when the Send Email action runs, so deleting the Document afterward does not affect the email that was sent.
  • If you delete the PDF, do not use Link Only or Attachment and Link. The link in the email would point to a Document that no longer exists.
  • Put the Merge Document Template action before any Send Email action in the Add-In. An email action looks up the Record's Documents once, and a later email action in the same run does not see Documents created after that.
  • To let the user choose the recipient each time, add a Prompt Value under Data Entry Options for the address field. On the Record screen the value the user enters is saved to the Record before the actions run, so [CustomerEmail] in the email picks it up.
  • To keep a record of what was sent, add an Add Record Note action at the end with text such as "Quote emailed to [CustomerEmail] by [USERFULLNAME]".