Hi All I have used send email using Suitelet 2.0, ...
# suitescript
s
Hi All I have used send email using Suitelet 2.0, with different type of attachments including (csv and pdf), both file size are less then 1 MB, email is successfully sent, but weird issue is that Gmail only show pdf file not csv , on the other hand when i have sent email on Outlook, it show both files in attachment Please guide me Thank you
b
what does the code look like
s
@battk Here is the code
Copy code
var transactionPdfFile = render.transaction({
                    entityId: parseInt(invId),
                    printMode: render.PrintMode.PDF
                });

                // saved PDF file in File Cabiner

                var pdfFile = file.create({
                    name: transactionPdfFile.name,
                    fileType: file.Type.PDF,
                    contents: transactionPdfFile.getContents(),
                    folder: 546,
                    isOnline: true
                });
                var pdfFileId = pdfFile.save();

                var pdfFileLoad = file.load({
                    id: parseInt(pdfFileId)
                });

var csvFileLoad = file.load({
                    id: parseInt(csvFileId)
                });

var attachmentsArr = [];
                attachmentsArr.push(csvFileLoad)
                attachmentsArr.push(pdfFileLoad)

email.send({
                        author: 181,
                        recipients: custEmail,
                        subject: emailSubject,
                        body: emailBody,
                        attachments: attachmentsArr,
                        relatedRecords: {
                            transactionId: invId
                        }
                    });
b
that looks reasonable, unless you are doing something weird with the file names like naming them the same thing
that looks reasonable, unless you are doing something weird with the file names like naming them the same thing
it looks like you are attaching the email to an invoice, so check the message sublist of the invoice to make sure the attachment is there