Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit de16227

Browse files
committed
Include download links in verification emails
1 parent 9a560b3 commit de16227

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

site/plugins/shopkit/snippets/mail.order.notify.status.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@
1616
foreach ($txn->products()->toStructure() as $item) {
1717
$body .= $item->name()->value.' - '.$item->variant()->value;
1818
$body .= $item->option() == '' ? '' : ' - '.$item->option()->value;
19-
$body .= "\n"._t('qty').$item->quantity()->value."\n\n";
19+
$body .= "\n"._t('qty').$item->quantity()->value;
20+
21+
// Include download links
22+
if ($downloads = $item->downloads() and $downloads->isNotEmpty() and $downloads->files()->isNotEmpty() and page($item->uri())) {
23+
if ($downloads->expires()->isEmpty() or $downloads->expires()->value > time()) {
24+
foreach ($downloads->files() as $file) {
25+
$hash = page($item->uri())->file(substr($file, strrpos($file,'/')+1))->hash();
26+
$body .= "\n"._t('download-file').': '.u($item->uri().'/'.$item->variant().'/download/'.$txn->uid().'/'.$hash);
27+
}
28+
}
29+
}
30+
31+
$body .= "\n\n";
2032
}
2133

2234
// Send the email

0 commit comments

Comments
 (0)