Sending record attachments with email

Organizations often maintain documents attached to data records, in the record’s Notes and Attachments related list in Salesforce. For example, you might attach a job applicant’s resume and cover letter to the applicant’s Contact record, or the Proposal or Service Level Agreement documents to each Opportunity record.

When generating email messages with content from such records, you might need to include the record attachments with the email. For instance, you might want to send a job applicant’s resume and cover letter to an evaluator on your team. Apsona’s Document and Mail Merge add-on lets you include such record attachments with sent email.

The process for generating email messages using the add-on is described elsewhere. To include specifically-named attachments with an email, you need only tell the email generator what pieces of text should be used to uniquely match the attachment name, as follows.

  • Create the merge action for generating email as described in the email generator page.
  • In the last step of the merge action creator, click the “Email options” panel. See screen shot below. 

    • Check the box that specifies record attachments for outbound email (see the highlighted part in the screen shot above).
    • In the object selector, select the object whose attachments are to be included. In the above example screen shot, the Contact object has been selected. Note that, in order for an object to appear in the object selector, the record ID of that object must be available in the report or base object from which the email merge is being run, as described in the documentation about logging.
    • Provide comma-separated match strings to select the matching attachments. In the above example, the two match strings are resume and letter, separated by a comma. (You can specify as many match strings as you want.) For each selected record for which email is being generated, Apsona finds every attachment whose name contains one of the given match strings. (Matching is case-insensitive.) For each match string, it then selects the most recently-modified attachment (based on Last Modified Date) that matches, and attaches it to the email. In the above screen shot example, if Apsona finds three attachments named resume1.pdfMy Resume.pdf and resume2.pdf, it selects the one that is modified more recently.

Powered by BetterDocs