Add template customisation

Includes integration test.