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
This commit is contained in:
Paul Huliganga 2026-03-13 11:15:30 -04:00
parent 71a156df78
commit 3f3fe8dd71
1 changed files with 10 additions and 1 deletions

View File

@ -230,7 +230,16 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
if (envelopeSubject.length() > 100) { if (envelopeSubject.length() > 100) {
envelopeSubject = envelopeSubject.left(97) + '...'; 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); myEnvelope = myEnvelope.withEmail(envelopeSubject, envelopeBody);
// Send the envelope // Send the envelope