netsuite - emailMerger.setEntity() Seems to be not merging the used template with the entity -


i'm trying send template mail(scriptable) on user event customer in sandbox , below code :

var emailmerger = nlapicreateemailmerger('22'); emailmerger.setentity('customer', customerid);  // emailmerger.setrecipient('customer', customerid); var mergeresult = emailmerger.merge(); var emailsubject = mergeresult.getsubject(); var emailbody = mergeresult.getbody();   emailbody = emailbody.replace('{1}', name); emailbody = emailbody.replace('{2}', date);  nlapisendemail('20', 'user1@mytestserver.com', 'test mail',emailbody, null, null, null, null); 

but unfortunately, i'm unable see mail merged under communication tab in customer. i'm missing here ?

var obj = nlapiloadfile(9398); var records = new object(); records['entity'] = '1752'; nlapisendemail('-5', '-5', 'emailsubject','emailbody', null, null, records, [obj]);  work mail , attachment save in communication tab. 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -