Automate emails with Process Builder

Please note that automation is only available to S-Docs Unlimited Edition customers for an additional fee. Click here to contact our team for more information.

Generating automated emails with S-Docs Jobs is simple, and using the Process Builder is the quickest approach. For information on automation and batch processing, click here.

Video Tutorial

The following video will go over 2 examples:

  1. Auto-sending a welcome email to new clients
  2. Auto-sending an invoice for won opportunities.

You can also refer to the written instructions below the video for a similar example.

Auto-Generating A Welcome Email For New Contacts

In this example, we will generate an email welcome letter whenever a contact is created by using an S-Docs Job in a Salesforce Process. We'll use 2 templates for this process: an HTML template to fill out the body of the email, and a PDF template for the welcome letter that will be attached to the email. Make sure you specify an email address in the Email Settings tab of the HTML template; typically, you'd want to put {!} in the recipient field so that when this process is invoked, the email address is automatically specified for each unique contact created. Click here to learn more about creating email templates.

Before you begin, note the names of your templates, as you will need them later.

Note: You can also use a template's ID in place of a template's name for the "doclist" parameter. However, template IDs will change from sandbox to production orgs, so we recommend using the template names if possible. Keep in mind that if there are multiple templates in your org with the same name, all of them will generate if one of them is referenced by your process.

Create A New Process In Process Builder

Navigate to Setup > Build > Create > Workflow & Approvals > Process Builder and create a new Process by clicking New.

Fill in a name and optionally a description for your process. Choose to start the process when "A record changes." Click Save.

Add Your Object

Click Add Object, choose Contact, and start the process only when a record is created.

Add "No Criteria"

Then, we click Add Criteria and set it to No Criteria, since we want our Job to execute every time a new contact record is created.

Add The "Create A Record" Action

Next, click Add Action and choose Create a Record for our action type. Select SDoc Job for our record type.

If you are having trouble finding SDoc Job in the picklist, type in "SD" and SDoc Job will appear.

Add S-Doc Job Field Values

Next, we will add the following 5 field values:

Start JobThe type will be a Boolean set to ‘true’ so that the specified documents will automatically generate (and in this case, automatically email, as we have specified to do so using the Job’s email fields) upon the creation of this particular S-Doc Job record.

Send EmailThe type will be a String with a value of ‘1,’ so that an S-Doc Job record will email the document it generated. If we set this to ‘0,’ an email will not be sent, thus, we will be setting this to ‘1.’

Object ID: The type is a Reference because we are referring to the ID of the record we are creating objects for, and we look up the value "Contact ID." This gives this field the value [Contact].Id, so when this S-Doc Job runs for a newly created contact, it will know that contact's ID.

Object API NameThe type is a String and it is the API name of our objects. In our example, we’re creating this trigger for new contacts, so we store Contact in this field.

Doclist: The type is a String. The value is the comma-delimited list of S-Docs template names that we will be using to generate our documents. Make sure there aren’t any spaces in your comma-delimited list. In our example, Welcome Letter is the name of our S-Doc template for a welcome letter PDF, and Email Template is the name of our S-Doc template for an HTML email.

Additionally, if we wanted this S-Doc Job to be run as a different user, we would click Add Row and add the "Run as User" field. For "Value," we would enter the username of the user we want this Job to be run under.

Then, we click Save and click Activate at the top right of the screen.

All done! S-Docs will now automatically generate and email a welcome letter whenever a contact is created.

Additional Fields

While we only used 5 fields in the process above, S-Docs Jobs also support a number of other fields that you can use to further customize your process.

Email From

Email From allows you to set an org-wide email address as the From address when your S-Docs Job process includes emailing a document.

Email Params

Email Params allows you to add advanced email parameters to your process that are not available to access through standard fields on the S-Docs Job object, such as useExistingNoContactRecord=true.

Incl. Attachments with Email

Incl. Attachments with Email allows you to specify a comma-delimited list of Salesforce Attachment IDs to be included in the email sent out by the S-Docs Job.

Incl. Documents with Email

Incl. Documents with Email allows you to specify a comma-delimited list of Salesforce Document IDs to be included in the email sent out by the S-Docs Job.

Incl. Files with Email

Incl. Files with Email allows you to specify a comma-delimited list of Salesforce File IDs to be included in the email sent out by the S-Docs Job.

Tags: , ,

Was this helpful?