Public link for an invoice 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

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


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?
You could write a simple plugin, that exposed an anonymous controller action that mimicked Commerce's Commerce_DownloadsController's actionPdf() method.