What is the URL of my file on server?


I was trying to use the simonhochrein:mjml but on my method sendMail, I was enable to get the mjml file. No matters where I put it (same folder, directory in /server or in the /public folder), I was getting a server error saying that the file could not be found. So I tryied to use a template and the SSR package but I have the same problem. I can’t found the file.

What is the URL of a file when I want to use it inside a method in the server code?

Thanks :slight_smile:


Put your .mjml file in /private, then reference it using Assets.absoluteFilePath. For example:

const email = new MJML(Assets.absoluteFilePath('file.mjml'));


Thanks hwillson! I didn’t found the doc part.