hello everyone, Does someone know how can I auto ...
# suitescript
m
hello everyone, Does someone know how can I auto BCC email to Email message that is being sent using Suitelet using nlapiCreateRecord?
s
You mean you need to send email when the record is created from suitelet?
m
var messageRecord= nlapiCreateRecord('message'); var today= new Date(); var CurrDate= nlapiDateToString(today, 'date'); messageRecord.setFieldValue('messagedate',CurrDate); var subject= EmailSubject; messageRecord.setFieldValue('subject',subject); //if(nzCustomer == 'T') // { nlapiSelectNewLineItem('otherrecipientslist'); nlapiSetCurrentLineItemValue('otherrecipientslist', 'email', 'mrudul@vnmtsolutions.com'); nlapiSetCurrentLineItemValue('otherrecipientslist', 'cc', 'T'); nlapiCommitLineItem('otherrecipientslist'); // } messageRecord.setFieldValue('hasattachment','T'); messageRecord.setFieldValue('transaction',recordId); var customer= SalesRec.getFieldValue('entity'); messageRecord.setFieldValue('entity',customer); //var from='30771'; var message=EmailBody; messageRecord.setFieldValue('message',message); messageRecord.setFieldValue('author',from); messageRecord.setFieldValue('recipientemail',receipients[a]); messageRecord.setFieldValue('recipient',null); if(deptId == 18){ messageRecord.selectNewLineItem('mediaitem'); messageRecord.setCurrentLineItemValue('mediaitem','mediaitem', CSVfile); messageRecord.commitLineItem('mediaitem'); } messageRecord.selectNewLineItem('mediaitem'); messageRecord.setCurrentLineItemValue('mediaitem','mediaitem', PDFfile); messageRecord.commitLineItem('mediaitem'); var submitMessageRecord= nlapiSubmitRecord(messageRecord,true,true);
this is part of the suitelet
s
you can use nlapiSendEmail api to send email where you can pass bcc argument
m
could i sent multiple attachment using nlapiSendEmail?
s
Yes you can . Make sure it doesnt cross 10MB
m
would you know why would the code I have mentioned above won't work for CC / BCC
?
s
I am not clear with your script. What are you trying to achieve
m
I am creating an Message Record in suitelet, Message gets sent to email fine, but I am trying to make the BCC / CC lines inserted.
s
I am not pretty sure.
has an example that uses ccbcclist sublist