Suitescript Reference File Without Domain
How do you reference images that are stored in your Filing Cabinet when trying to embed them into HTML. For example, when using logos in your emails how do you reference them? When constructing emails that are used within SuiteScript you would think you’d need to construct the emails with both the url of the file AND the domain of your Netsuite instance, perhaps coded like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import url = require("N/url"); import file = require("N/file"); const fn () => { const fileId = 0; const domain = url.resolveDomain({ hostType: url.HostType.APPLICATION }); const imgFile = file.load({ id: fileId }); // construction of the full URL for use outside Netsuite, right? const imgUrl = `${domain}${imgFile.url}`; return `<img src="${imgUrl}">`; } However, the result from this function is https://0000.app.netsuite.comhttps://0000.app.netsuite.com/yourFileLocation ...