For using curl inside a template, it must be told about the proxy. This post might help:
Let us know if it does…