Question
Need Best approach for Attaching a PDF( Base64 value) to an email in PEGA and store that mail
Below is the approach :
1. Got the Base64 code from a third party provider via REST service .
2. Passed that Base64 code in an activity to generate a PDF in a new window using the below code successfully .
String s = tools.getParamValue("Data").toString(); //Data is the base64 encoded string (Parameter) byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(s); tools.putParamValue("Data",byteArray); tools.sendFile(byteArray,"PDFName.pdf",false, null, true);
3. Need a good approach to pass this Base64code to a fixed mail format and have the whole thing(mail+Attachment) stored in some property (the same will be passed to repository) .