Contact Form plugin - different recipients per locale What is the best way to define different sendto emails addresses for the ContactForm plugin, depending on the locale the site is currently viewed in?

I am setting up a multilanguage site, and the clients want to have different emails for each language version.

So far I figure a possible way would be to have separate, localized contactform templates, and in each of them define a dynamically-added recipient. But I wondered if there's a better option, e.g. locale-specific options in craft/config/contactform.php?

Thank you
You could write a plugin, which hooks in the contact form's onBeforeSend event, and modifies the recipients.

Here's an absolute bare-bones solution which does exactly that (not tested in any way whatsoever):

&lt;?php namespace Craft;

class ExamplePlugin extends BasePlugin
{
    // Standard plugin methods omitted for brevity...

    public function init()
    {
        craft()-&gt;on('contactform.beforeSend', function (Event &amp;$event) {
            $event-&gt;toEmail = 'john@doe.com';
        });
    }
}


Whether or not this is "officially" supported is unclear.

The fact it's an event (as opposed to a hook) might suggest not, but the contact form does check whether any listeners modified the event data, as evidenced by its check of the isValid property.