I want to add a asset (image) full url (with domain and base) in a twig template when running from a command line (Console Command). It's meant to be sent to email.
The problem is, using absolute_url(asset()) doesn't include the host and base path when running on console.
Also, as specificed in http://symfony.com/doc/current/console/request_context.html, it just works for urls, not for assets.
I've also tried to set the router context when running from console:
$context = $this->getContainer()->get('router')->getContext();
$context->setHost($defaultDomain);
$context->setScheme($scheme);
With no success. Any idea?