Send an email with a link to download documents

A Score Level 1
Hi all!
We need to send an email with a link that allows users to directly access the download of the documents (after authenticating in the application). instead of sending them as attachments.
We have found the following discussion Appian Community and we have developed like this.
We have included in our HTML template:
      <a href="https://your environment/suite/doc/###docid###?appian_environment=designer">Download Document</a>
and it worked.
The problem is when we have moved to another environment. We have just updated the name of the environment:
      <a href="https://new environment/suite/doc/###docid###?appian_environment=designer">Download Document</a>
And now its not working, we got the following error: 

Application Error

We're sorry! We could not process your last request.

  • There are no details available for this problem.
  • If you continue having problems, please contact the system administrator for further help.

Could anyone of you help us to solve this issue or to propose another way to do it?

Thanks in advance.

  Discussion posts and replies are publicly visible