diff --git a/src/HTMLBuilder/Manager/ButtonManager.php b/src/HTMLBuilder/Manager/ButtonManager.php index 43b2fc686..8d43c4f9c 100755 --- a/src/HTMLBuilder/Manager/ButtonManager.php +++ b/src/HTMLBuilder/Manager/ButtonManager.php @@ -118,9 +118,9 @@ class ButtonManager implements ManagerInterface if ($options['type'] == 'print') { $results = \Prints::getModulePrints($options['id_module']); } elseif ($options['type'] == 'email') { - $results = TemplateEmail::where('id_module', $options['id_module'])->get()->toArray(); + $results = TemplateEmail::where('id_module', $options['id_module'])->orderBy('name')->get()->toArray(); } elseif ($options['type'] == 'sms') { - $results = TemplateSMS::where('id_module', $options['id_module'])->get()->toArray(); + $results = TemplateSMS::where('id_module', $options['id_module'])->orderBy('name')->get()->toArray(); } return $results;