BryanB Posted May 10, 2010 Share Posted May 10, 2010 I thought this might be useful for anyone interested. I needed a way to send my clients large uploads that sometimes were not being received through email, so I created an area above each support ticket that displays all attachments sent from an admin in a "storage bin" box. This way they could click on the support ticket link or log into their client area and view the ticket and download the attachments... Sort of like a "YouSendIt.com" feature. Here's what it looks like: http://screencast.com/t/MWZmZDdl Here's the code I've added to /whmcs/templates/YOURTEMPLATE/viewticket.tpl <div class="photostorageheader"> <table width="100%" border="0" cellpadding="10" cellspacing="0"> <tr> <td align="left"><b>Storage Bin</b></td> </tr> </table> </div> {php} $this->assign(replies,array_reverse($this->_tpl_vars['replies'],true)); {/php} <div class="photostorage"> <b>Click a file name to download and view the file.</b><br /> {foreach key=num item=reply from=$replies} {if $reply.admin && $reply.attachments}<br /> {$reply.date}<br /> {foreach from=$reply.attachments key=num item=attachment} <img src="images/article.gif" class="absmiddle" border="0" alt="{$attachment}" /> <a href="dl.php?type=ar&id={$reply.id}&i={$num}">{$attachment}</a><br /> {/foreach}{/if} {/foreach} </div> Custom CSS to put them in a green box: Add below to whmcs/templates/YOURTEMPLATE/styles.css .photostorageheader{ background-color:#A4F8A4; color:#333; border-top:1px solid #A4F8A4; border-right:1px solid #A4F8A4; border-bottom:1px solid #A4F8A4; border-left:1px solid #A4F8A4 } .photostorage{ background-color:#EBFFF1; padding:10px; margin:0 0 10px; border-right:1px solid #A4F8A4; border-bottom:1px solid #A4F8A4; border-left:1px solid #A4F8A4; } 0 Quote Link to comment Share on other sites More sharing options...
BryanB Posted May 10, 2010 Author Share Posted May 10, 2010 The next step is to edit the emails that are sent out to not include the attachments when sending from a particular department. This will help improve email deliverability since some email clients will not be able to receive large files. 0 Quote Link to comment Share on other sites More sharing options...
edvan.com.br Posted May 10, 2010 Share Posted May 10, 2010 good tip ... I tried to include attachments of customers but unsuccessfully! 0 Quote Link to comment Share on other sites More sharing options...
BryanB Posted May 10, 2010 Author Share Posted May 10, 2010 good tip ... I tried to include attachments of customers but unsuccessfully! I haven't tested it but you should just have to get rid of the "$reply.admin &&" part so it should look like this instead: <div class="photostorageheader"> <table width="100%" border="0" cellpadding="10" cellspacing="0"> <tr> <td align="left"><b>Storage Bin</b></td> </tr> </table> </div> {php} $this->assign(replies,array_reverse($this->_tpl_vars['replies'],true)); {/php} <div class="photostorage"> <b>Click a file name to download and view the file.</b><br /> {foreach key=num item=reply from=$replies} {if $reply.attachments}<br /> {$reply.date}<br /> {foreach from=$reply.attachments key=num item=attachment} <img src="images/article.gif" class="absmiddle" border="0" alt="{$attachment}" /> <a href="dl.php?type=ar&id={$reply.id}&i={$num}">{$attachment}</a><br /> {/foreach}{/if} {/foreach} </div> 0 Quote Link to comment Share on other sites More sharing options...
BryanB Posted May 10, 2010 Author Share Posted May 10, 2010 by the way, I'm adding this after about line 54 after <td>{$urgency}</td> {foreach key=num item=customfield from=$customfields}<td>{$customfield.value}</td>{/foreach} </tr> </table> 0 Quote Link to comment Share on other sites More sharing options...
edvan.com.br Posted May 11, 2010 Share Posted May 11, 2010 It did not work! I tried: if $reply.user && $reply.attachments did not work! 0 Quote Link to comment Share on other sites More sharing options...
BryanB Posted May 11, 2010 Author Share Posted May 11, 2010 I just tested what I posted above and it worked fine. you don't need if $reply.user... Simply look for: {if $reply.admin && $reply.attachments} and change it to: {if $reply.attachments} and that's it. 0 Quote Link to comment Share on other sites More sharing options...
edvan.com.br Posted May 11, 2010 Share Posted May 11, 2010 see image http://edvan.net.br/storage.jpg doubles the attachment you sent the team. <div class="photostorageheader"> <table width="100%" border="0" cellpadding="10" cellspacing="0"> <tr> <td align="left"><b>Storage Bin</b></td> </tr> </table> </div> {php} $this->assign(replies,array_reverse($this->_tpl_vars['replies'],true)); {/php} <div class="photostorage"> <b>Click a file name to download and view the file.</b><br /> {foreach key=num item=reply from=$replies} {if $reply.admin && $reply.attachments}<br /> {$reply.date}<br /> {foreach from=$reply.attachments key=num item=attachment} <img src="images/article.gif" class="absmiddle" border="0" alt="{$attachment}" /> <a href="dl.php?type=ar&id={$reply.id}&i={$num}">{$attachment}</a><br /> {/foreach}{/if} {/foreach} </div> <div class="photostorageheader"> <table width="100%" border="0" cellpadding="10" cellspacing="0"> <tr> <td align="left"><b>Storage Bin (client)</b></td> </tr> </table> </div> {php} $this->assign(replies,array_reverse($this->_tpl_vars['replies'],true)); {/php} <div class="photostorage"> <b>Click a file name to download and view the file.</b><br /> {foreach key=num item=reply from=$replies} {if $reply.attachments}<br /> {$reply.date}<br /> {foreach from=$reply.attachments key=num item=attachment} <img src="images/article.gif" class="absmiddle" border="0" alt="{$attachment}" /> <a href="dl.php?type=ar&id={$reply.id}&i={$num}">{$attachment}</a><br /> {/foreach}{/if} {/foreach} </div> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.