Custom theme function with drupal render
What I wanted to do is to get the html through a function and not a template. So actually there is no need to set the variables, just the 'render element' did the trick.

function custom_module_theme() {
  return array(
    'custom_module_link' =&gt; array(
      'render element' =&gt; 'element',
    ),
  );
}