Uniform multilanguage snippets

Hi
Is there a way to use multilanguage with Uniform ? I would like to use an english version of the snippet from the emailAction. This is how I’running :

->emailAction([
                
                'to' => $form->data('email_cli'),
                'from' => 'mymail@servor.org',
                'service' => 'html-mail',
                 // Here the french subject
                'subject' => 'Merci pour votre commande sur Rotolux Press',
                // Here the french snippet
                'snippet' => 'emails/success',
            ]);

In the snippet and for the subject, you can use language variables, can’t you? Check the docs how to use l::set() and l::get().

https://getkirby.com/docs/languages/variables

1 Like

Okay for the snippet wich can be edited easily, but I don’t see how to do it with the subject, because the only line for it appears inside the controller…

Can I use l::get() inside controller ?

Yes, of course you can.

I didn’t try but, something like this ?

'subject' => l::get('subject'),

Exactly :+1: (and some more …)

1 Like