Example Drawloop Setup
Example - Certificate of Completion for a Course
On completion of a workshop run by you, controlled by the Campaign Member object, you want to send a nice looking certificate to the client.
STOP
Well, let's just say, this is rather disappointing. Drawloop can NOT send emails out from the Campaign Member object, using Salesforce email. This is because the Campaign Member object is not a full Salesforce object (see Campaign Member), and it doesn't have Activities. Workarounds are:
- Use another object - this is what I did - I had an enrollment object related to Campaign Member, so I could still relate back to Campaign and Contact from my enrollment object, which gave me the fields I needed.
- Use SMPT Email - if you have access to SMPT (ask your IT department), you can send via that.
The following guide will use the Enrollment object that is linked to the Campaign.
Prerequisite
- Have your basic word document created.
- Have your images created and your images set up in Salesforce - basically add a URL field to the Object you want the image to be on, and include in that field the URL to the publicly available image hosted in Salesforce documents. (Note, you do not have to do the convoluted method as described in the help document here http://support.drawloop.com/lds/document-help/word/images).
- Have your Email Template created.
Create the DDP - wizard
- DDP Tab > New
- Enter the details
- Name - Certificate of Completion
- Type - know that you can add more types by modifying the field, or choose Other and enter an Other value.
- Output filename - <<Campaign_Name>> Certificate of Completion - <<Contact_DisplayName>>
- Note Display Name in Contact is a custom field that joins the Salutation, First Name and Last Name, using the LocalName fields if they are filled in, otherwise the standard names. I always like doing a formula for scenarios like this, because you can then use it everywhere, and it's consistent, and you can change it only in one place.
- Object Name - Enrollment
- Contact Selection Required.
- Include Attachments - none
- Set the security level (eg some documents may only be able to be created by specific users).
- Next - add a delivery option
- Salesforce Email
- Document Storage - None.
- Yes, you want to store the document, but I like to use Chatter rather than attachments.
- Document Output Type - PDF
- Next - Relationships
- Related By - Enrollment
- Relationship - Contact
- Related By - Lookup
- All the rest as standard.
- We need a relationship to Campaign also, but we will leave it for now and do it after the wizard is created.
- Next - Edit
- Type - Chatter Post
- Subject - Certificate of Completion attached
- Include DDP Output in Post
- Type - Field Update
- Enrollment
- Certificate Sent Date
- <<Today>>
- This helps us when we send the document off automatically.
- Type - Chatter Post
- Next - Tag Documents
- This is where you go through your Word document, and put in the correct fields.
- Be sure that Word/Powerpoint is chosen
- You can skip this screen for now, and come back to it later.
- Next - Upload Documents
- I like to skip this step for now, and go into the advanced settings.
- So just choose any file for now.
- Click Save.
Advanced Setup
- Filter - Complete
- This is a field on the Enrollment where we are only sending this document if the Status is Complete - we set this up on the Loop button.
- Limit Deployment - Web
- Delivery Options - Email
- Uncheck Wait for document to process
- Relationships
- Add a Relationship to Campaign
- Document
- Add the document to be sent by this DDP.
Now the DDP is all set up to send the document via PDF.
Don't set the italicised fields until after you have tested the DDP.
Finalise Document
- Insert all your fields using the Field Tagger http://support.drawloop.com/lds/document-help/field-tagger
- Insert dynamic images using the Field Tagger then choosing the Type of Insert as Image.
- Use advanced Word field tricks for conditional fields (or put the conditions in your formulas in Salesforce) http://word.mvps.org/faqs/mailmerge/mmergeiffields.htm and http://support.drawloop.com/lds/document-help/word/conditional-text
- Apply formatting to fields in word if needed http://www.gmayor.com/formatting_word_fields.htm (but try formatting them in the field tagger first, or even create a formula field in Salesforce).
- Know how to toggle fields on and off in Word http://mikefrobbins.com/2010/05/10/how-to-toggle-field-codes-off-or-on-in-word/
Test Document
To test the document, we will add it to a button.
Go back to the DDP Admin screen and use the Deployment Wizard button.
- Button Name = Certificate of Completion
- Starting Object = Enrollment
- Single Record Button
- Contact = Contact ID
- Hide Contact Selection
- Hide DDP Selection
- Auto Run
- Attach Back
- DDP IDs = the id of the DDP we created.
- Click Generate Button - it's magic! (well for standard objects it is - there are a few more steps for custom objects).
Don't set the italicised settings until after you have tested the DDP.
Add the button to the page layout
Now go to a Enrollment record, click the button and see what happens.
The email should send to the Contact, should add a Chatter Post, and update the field on the Enrollment.
Automate the Document
Drawloop buttons are great, but we don't want to have to do this manually each time. We want to send the certificate of completion automatically, when the enrollment is marked as complete. We will follow the steps on this page. http://support.drawloop.com/lds/getting-started/additional-deployments/automated-ddps
Firstly, go back to your button and test that everything is working well (add back in all the parameters you left off in testing) - if it runs OK in an automated fashion after you click the button, then it's time to add the Outbound Message and Workflow.
Outbound Message
Follow the steps here http://support.drawloop.com/lds/getting-started/additional-deployments/automated-ddps TO THE LETTER
- Note: use the exact API Name with SF in front of it - eg SFMyObject__c
Workflow
Ensure the workflow is only run if the Certificate Sent Date is blank AND the Status is Complete AND the workflow is set to "Evaluate the rule when a record is created, and any time it’s edited to subsequently meet criteria". Therefore the certificate will only be sent once, because when we send the Document we get Drawloop to update the Date Sent.