This topic contains 2 replies, has 0 voices, and was last updated by chanarbon 7 years, 11 months ago.

  • Author
    Posts
  • #6149 Score: 0

    Charles Li
    • Contributions: 0
    • Level 1

    Dear All,

    Afrer release 2 updated, it announced that we can’t use nlapiMergeRecord to send email with CRSMDK template. We should use nlapiCreateEmail api to send scriptable template email. So i changed the script and the template. But when i used nlapiMergeRecord before, it has 6 parameters, id, baseType, baseId, altType, altId, fields.

    But help center said: To perform a mail merge with a scriptable email template:Use nlapiCreateEmailMerger(templateId) to create an nlobjEmailMerger object. The function nlapiCreateEmailMerger(templateId) takes the record ID of a scriptable template as an argument. The objectnlobjEmailMerger encapsulates the scriptable template.

    var emailMerger = nlapiCreateEmailMerger();
    Use the nlobjEmailMerger set methods to designate the records to perform the mail merge on.

    emailMerger.setEntity(, ); emailMerger.setRecipient(, ); emailMerger.setSupportCase(); emailMerger.setTransaction(); emailMerger.setCustomRecord(, );
    Use the nlobjEmailMerger.merge() method to perform the mail merge. The merge() method returns an nlobjMergeResult object that contains the subject and body of the e-mail distribution.

    Note

    The nlobjEmailMerger.merge() method has a governance of 20 usage units. The remaining APIs described here have no governance.

    var mergeResult = emailMerger.merge();
    Use the nlobjMergeResult methods to obtain the e-mail distribution’s subject and body in string format.

    var emailSubject = mergeResult.getSubject(); var emailBody = mergeResult.getBody();
    In step 2, the record can perform the email on doesn’t include event. I want that after i create a event based on a case, system will send email as the specific template. With nlapiMergeRecord, i can set basetype(supportcase) and alttype(event), but with nlapiCreateEmail, i only can set supportcase type and the id, via setSupportCase api. Which should i use to link event id and then i can catch the value on event?
    This is a cached copy. Click here to see the original post.

  • #6150 Score: 0

    k_dunc
    • Contributions: 0
    • Level 1

    Hi Charles,

    I don’t believe there is a ‘nlapiCreateEmail’ API. Yes, you should create a scriptable email template, then use the ‘nlapiCreateEmailMerger’ API to link your record to the template. After calling the ‘.merge()’ method, you would then next use the ‘nlapiSendEmail’ API to actually send the email.

    This link might help.

  • #6151 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Hi Charles,

    For this concern, we have already published SuiteAnswers article on how to properly concern address the concern which is SuiteAnswer ID 60833 (https://netsuite.custhelp.com/app/an…ail/a_id/60833)

    As for the second concern regaring baseType and altType,since I haven’t checked much on it but have you tried utilizing the seventh parameter of nlapiSendEmail()

You must be logged in to reply to this topic.