String envelopeSubject = combinedName; // Truncate subject to 100 characters maximum as required by Docusign if (envelopeSubject.length() > 100) { envelopeSubject = envelopeSubject.left(97) + '...'; } String envelopeBody = bodyParts.isEmpty() ? '' : String.join(bodyParts, '\n\n---\n\n'); myEnvelope = myEnvelope.withEmail(envelopeSubject, envelopeBody);