Improved detection of params in mail templates