Anyone have to add email templates to a SDF packag...
# sdf
j
Anyone have to add email templates to a SDF package where you need to explicitly include all of the object paths?
Copy code
<objects>
        <path>~/Objects/custemailtmpl_aura_recurring_donation_email.xml</path>
        <path>~/Objects/custemailtmpl_aura_recurring_donation_email.template.html</path>
        <path>~/Objects/custemailtmpl_aura_single_donation_email.xml</path>
        <path>~/Objects/custemailtmpl_aura_single_donation_email.template.html</path>
Project validate reports:
Copy code
➜  TestStagingR git:(task/16021) ✗ suitecloud project:validate --server
The validation process has encountered an error.
Validating against TSTDRV2294847 - Aura MemberPlex Development - Aura Integration Role.
*** ERROR ***

Validation failed.

An error occurred during deploy file validation.
Details: An XML file is expected instead of ~/Objects/custemailtmpl_aura_recurring_donation_email.template.html.
Details: An XML file is expected instead of ~/Objects/custemailtmpl_aura_single_donation_email.template.html.
File: ~/deploy.xml
Leaving them out/commenting the template sout and i get:
Copy code
➜  TestStagingR git:(task/16021) ✗ suitecloud project:validate --server
The validation process has encountered an error.
Validating against TSTDRV2294847 - Aura MemberPlex Development - Aura Integration Role.
Validate manifest -- Success
Validate deploy file -- Success
Validate configuration -- Success
Validate objects -- Failed

WARNING -- One or more potential issues were found during custom object validation. (custentity_aura_customerdisplayname)
Details: The appliestogenericrsrc field depends on the ADVANCEDJOBS feature. The manifest must define the ADVANCEDJOBS feature as required or optional.
File: ~/Objects/custentity_aura_customerdisplayname.xml

WARNING -- One or more potential issues were found during custom object validation. (custentity_nccer_custnumber)
Details: The appliestogenericrsrc field depends on the ADVANCEDJOBS feature. The manifest must define the ADVANCEDJOBS feature as required or optional.
File: ~/Objects/custentity_nccer_custnumber.xml
Validate files -- Success
Validate folders -- Success
Validate translation imports -- Success
Validation of referenceability from custom objects to translations collection strings in progress. -- Success
Validate preferences -- Success
Validate flags -- Success
Validate for circular dependencies -- Success
*** ERROR ***

Validation failed.

An error occurred during custom object validation. (custemailtmpl_aura_recurring_donation_email)
Details: Provide a non-empty template file.
File: ~/Objects/custemailtmpl_aura_recurring_donation_email.xml

An error occurred during custom object validation. (custemailtmpl_aura_single_donation_email)
Details: Provide a non-empty template file.
File: ~/Objects/custemailtmpl_aura_single_donation_email.xml
d
I have not done this myself specifically with email templates, but a couple of things crossed my mind to try: • put the .template.html corresponding files ordered first before the .xml itself ◦ if the template is considered dependent (https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/SDFxml_2610359453.html) ordering may matter • or, put the email .xml & .template.html files in their own `emailtemplates`directory, and then just specify in deploy.xml like
~/Objects/emailtemplates/*
◦ hopefully SDF then just sorts out all the dependency ordering logic on its own then ◦ imo probably better option regardless, at least I like to structure SDF projects into nested related object-type grouping anyways so things are a bit more organized within /Objects
j
Great shout on the second bullet point! I hadn’t thought of that! I think that gets me by my current hurdle. I’m just getting to where this package is getting rather large, and I need to add some organization as well. I opened a support ticket with netsuite as well. It’s been a bit challenging to find support folks that have any experience with SDF in general. Everyone has tried to be helpful and that’s been a good experience, but I can tell I’m pushing the edges of what they’re comfortable with. Appreciate the time, as always!
d
also idk where your Templates are located (ref to
mediaitem
node at bottom of link https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1515596181.html), but if is similar then maybe need to place in local SDF project file structure under src/FileCabinet/Templates , and then specify the .html files similarly under the <files> portion of deploy.xml like
~/FileCabinet/Templates/E-mail Templates/*
, if that gets around potential limitation of Objects can only specify .xml file types and not .html etc
j
As a side question, when you’re organizing, do you organize by type of xml file (e.g.
custbody
custentity
etc) ?
d
so personally I like to somewhat mirror how a NS Account itself has the equivalent areas laid out with their Category areas etc., and then use the type names listed in https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/SDFxml.html something to this effect is my go-to structure to order things generally:
🙌 1
j
re: templates in the file cabinet, I don’t have a pref where they’re stored, it seems to be my netsuite folks’ preference to have them as assigned to the template xml (mediaitem == F) for ease of use. I tried to add them to the file cabinet and I realized I’d need to understand how to control folder permissions via SDF when I added them as documents. I quickly decided that that was going to require some back/forth with support and bailed 😅
ps- organization here worked like a champ. Leaned on the
/*
wildcard expression to boot whatever code they’re using to import the template file. I’m still going to try to speak with netsuite support in the case that i need to include templates by naming each reference. Stole your naming convention (thank you 🙌) and wound up with this
Copy code
<objects>
        <path>~/Objects/Centers and Tabs/entryForm/*</path>
        <path>~/Objects/Centers and Tabs/subtab/*</path>
        <path>~/Objects/Lists, Records, Fields/crmcustomfield/*</path>
        <path>~/Objects/Lists, Records, Fields/customlist/*</path>
        <path>~/Objects/Lists, Records, Fields/customrecordtype/*</path>
        <path>~/Objects/Lists, Records, Fields/entitycustomfield/*</path>
        <path>~/Objects/Lists, Records, Fields/itemcustomfield/*</path>
        <path>~/Objects/Lists, Records, Fields/transactionbodycustomfield/*</path>
        <path>~/Objects/Lists, Records, Fields/transactioncolumncustomfield/*</path>
        <path>~/Objects/Saved Searches/savedsearch/*</path>
        <path>~/Objects/Scripts/restlet/*</path>
        <path>~/Objects/Scripts/scheduledscript/*</path>
        <path>~/Objects/Scripts/workflowactionscript/*</path>
        <path>~/Objects/Templates/emailtemplate/*</path>
        <path>~/Objects/Templates/advancedpdftemplate/*</path>
        <path>~/Objects/Workflows/workflow/*</path>
    </objects>
👍 1
231 Views