Can anyone suggest the correct way of sending an email template as shown below based on the foreign language? I get the language from the url, I initially thought to use a switch but I would like to know if there is any other more clean solution.
$lang = $this->request->query['language'];
$email->addTo()->
setFrom('')->
setFromName('')->
setSubject(' ')->
setHtml(' ')->
addSubstitution())->
addSubstitution()->
addFilter("templates", "enable", 1)->
addFilter("templates", "template_id", '32e97d67-72d8-449e-a864-ffd088e72f26'));
$res = $sendgrid->send($email);