How to apply message templates