public static bool
updateTemplate
(mixed $key, mixed $subject, mixed $body, mixed $tags, mixed $htmlbody = '')
public static function updateTemplate($key, $subject, $body, $tags, $htmlbody = '')
{
$db = Factory::getDbo();
$template = new \stdClass();
$template->template_id = $key;
$template->language = '';
$template->subject = $subject;
$template->body = $body;
$template->htmlbody = $htmlbody;
$params = new \stdClass();
$params->tags = array($tags);
$template->params = json_encode($params);
return $db->updateObject('#__mail_templates', $template, ['template_id', 'language']);
}