Exp:resso Store 2.3.1 and EE 2.8.1.
How can I include a download link right in the Order Confirmation email that Store sends out for any downloadable products in that order?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityIncluding download links is perfectly possible.
First, set the Email Formatting to "HTML", since Store's Download Tag outputs HTML.
Second, use the same code in the email template that you would use in a regular EE template to display download links. Here's an example:
<ul>
{items}
<li>
{title}
{exp:channel:entries entry_id="{entry_id}"}
{exp:store:download url="{product_file}" order_id="{order_id}"}
Download
{/exp:store:download}
{/exp:channel:entries}
</li>
{/items}
</ul>
If you have multiple product channels (eg. "Books", "Music", etc) instead of a single "Products" channel, you need to add in some conditionals to only show download links for products in channels that have them. In the following example, only the "Music" channel has a downloadable product field:
<ul>
{items}
<li>
Title: {title}
{exp:channel:entries entry_id="{entry_id}"}
{if channel_short_name == 'music'}
{exp:store:download url="{music__file}" order_id="{order_id}"}
Download
{/exp:store:download}
{/if}
{/exp:channel:entries}
</li>
{/items}
</ul>