Attach the customer statement in the Email

     var transactionFile = render.statement({
                        entityId: JSON.parse(listCust.customerId), //16014,
                        printMode: render.PrintMode.PDF,
                        openTransactionsOnly: true,
                        statementDate: date,
                        inCustLocale: true
                    });
                    transactionFile.folder = 81256 // the folder to store PDF
                    var fileId = transactionFile.save();
                    email.send({
                        author: senderId,
                        recipients: contactEmailArr,
                        subject: 'Estatement',
                        body: 'Hello' + ' ' + ',' + 'nnPlease find attached your current statement.' + 'nnThank you,' + 'nnAccounting A/R' + 'n310-333-0606 x1189' + 'n800-800-6608' + 'nnMarshall Electronics, Inc.' + 'n20608 Madrona Avenue' + 'nTorrance, CA 90503' + 'nwww.Marshall-USA.com',
                        attachments: [transactionFile]
                    });
                   

Leave a comment

Your email address will not be published. Required fields are marked *