Use controller for mailform snippet

You only have to add the controller code to the “action” page. See this thread for an explanation: Newsletter form on multiple pages

Alternatively, there’s a great cookbook article about Shared Controllers.