From 3f3fe8dd715f418428e49e1ec81d430845da6cb4 Mon Sep 17 00:00:00 2001 From: Paul Huliganga Date: Fri, 13 Mar 2026 11:15:30 -0400 Subject: [PATCH] feat: add greeting, dividers, and sign-off to envelope email body - Prepend 'Hello,' greeting before first template body - Separate template bodies with a blank line + horizontal rule + blank line - Append 'Thank you, / Early Intervention Colorado' after last template body - Greeting + sign-off are included even when no templates supply a body --- .../classes/DocusignCompositeEnvelopeBuilder.cls | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls b/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls index 80558ec..26eb12d 100644 --- a/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls +++ b/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls @@ -230,7 +230,16 @@ global with sharing class DocusignCompositeEnvelopeBuilder { if (envelopeSubject.length() > 100) { envelopeSubject = envelopeSubject.left(97) + '...'; } - String envelopeBody = bodyParts.isEmpty() ? '' : String.join(bodyParts, '\n\n'); + // Compose body: greeting → template bodies separated by a visual divider → sign-off + String DIVIDER = '\n\n' + '─'.repeat(60) + '\n\n'; + String GREETING = 'Hello,\n\n'; + String SIGNOFF = '\n\nThank you,\nEarly Intervention Colorado'; + String envelopeBody; + if (bodyParts.isEmpty()) { + envelopeBody = GREETING + SIGNOFF; + } else { + envelopeBody = GREETING + String.join(bodyParts, DIVIDER) + SIGNOFF; + } myEnvelope = myEnvelope.withEmail(envelopeSubject, envelopeBody); // Send the envelope