Hello Tom,
I can understand why you are confused, please bear with me, I will start from the beginning.
My initial question was:
"How can I dynamically set baseUrl" which is used in the email template.
After our discussion we concluded that the best way to do so is to set req.baseUrl in a custom middleware.
So this is my current approach just to test it out:
function(site,req,res,next){
next();
}
Even though req.baseUrl is set in the middleware, it does not work because in the emailMixin.js code
first checks for "self.options.baseUrl". I **do not** set this either on app.js or in local.js because I want the code to use req.baseUrl. Even though I do not set this anywhere in my code "self.options.baseUrl" is always set to the **required** configuration option "hostName", which is mandatory.
This means that "self.options.baseUrl" is always set, and req.baseUrl is never used.
I hope this is clearer now.
FP