<p>You could write a <a href="https://pluginfactory.io/" rel="nofollow noreferrer">simple plugin</a>, that exposed an <a href="https://craftcms.com/docs/plugins/controllers#allowing-anonymous-access-to-actions" rel="nofollow noreferrer">anonymous controller action</a> that mimicked Commerce's <code>Commerce_DownloadsController</code>'s <code>actionPdf()</code> method.</p>

CC BY-SA 3.0
2017-02-24T18:29:01.653Z
2017-02-24T18:29:01.653Z
Brad Bell
<p>When an order is submitted on the Craft Commerce website I'm currently building, an email is automatically sent to the customer. Inside this email is a link to download an invoice for that specific order.</p>

<p>I had accomplished this by putting the following link into my emails</p>

<pre><code>&lt;a href="{{ siteUrl }}index.php/admin/actions/commerce/downloads/pdf?number={{ order.number }}"&gt;Download your invoice&lt;/a&gt;
</code></pre>

<p>It's not ideal as you could actually download any invoice by changing the order.number, but we fixed that by using a url proxy.</p>

<p>But I realised a few minutes ago that this link is not public and requires a login. Which I don't want.
Is there any way to generate a public link for the invoice?</p>

<plugin-craftcommerce>
Public link for an invoice
# Public link for an invoice

(Asked by: username_0 on 2017-02-24)

When an order is submitted on the Craft Commerce website I'm currently building, an email is automatically sent to the customer. Inside this email is a link to download an invoice for that specific order.
I had accomplished this by putting the following link into my emails
Download your invoice

It's not ideal as you could actually download any invoice by changing the order.number, but we fixed that by using a url proxy.
But I realised a few minutes ago that this link is not public and requires a login. Which I don't want.
Is there any way to generate a public link for the invoice?

**Tags:** plugin-craftcommerce


---

## 1 answers

### Answer by username_1 on 2017-02-24. Score: 1 | Accepted answer

You could write a [simple plugin](https://pluginfactory.io/), that exposed an [anonymous controller action](https://craftcms.com/docs/plugins/controllers#allowing-anonymous-access-to-actions) that mimicked Commerce's `Commerce_DownloadsController`'s `actionPdf()` method.


---

