How to pass lead customer record data to HTML file.

We can pass lead customer record data to HTML file. Here we using custid used for fetching the values from lead. Here we pass the data to the email template for sending mail.

try {var emailMerger = nlapiCreateEmailMerger(444);//444 is email template id
					emailMerger.setEntity('customer', Number(custid));
					var mergeResult = emailMerger.merge();
					var emailBody = mergeResult.getBody();
					nlapiSendEmail(authorid, recipient, subject,emailBody, cc, bcc);

                                         return {
						successMessage: 'Your request has been                       submitted.'
					}
				}

Leave a comment

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