Custom api_response - Total File Count

Discussion in 'LiquidFiles General' started by Cameron Weymouth, Oct 23, 2017.

  1. Cameron Weymouth

    Cameron Weymouth New Member

    Joined:
    Oct 23, 2017
    Messages:
    1
    Likes Received:
    0
    Hello,

    Is it possible for the api_response template to be changed so it states the total number of attached files rather than listing each file individually?

    We've had instances of users attaching a large amount of individual files with the Outlook plugin which is resulting in a awkwardly long list of attachments.under the files attached heading.
     
  2. David

    David Administrator
    Staff Member

    Joined:
    Dec 1, 2015
    Messages:
    707
    Likes Received:
    16
    The API template can't be changed, but Outlook client attaching only a link to the message which covers link to all uploaded files.
    The Outlook client can be set to display the message and the link at the end of the email in the "Options > Upload Message body".
     
  3. Johan

    Johan Administrator
    Staff Member

    Joined:
    Dec 1, 2015
    Messages:
    38
    Likes Received:
    1
    Actually, the API response is changeable in Admin → Configuration → Email Templates → API response.

    Instead of using the "for attachment" ... statement, you could use something like: {% attachment.size %} attachments attached to this message.

    Or you can use if statements to show the list of messages if there's 20 or less attachments, and just a count if there's more. Please see: https://shopify.github.io/liquid/filters/size/ for an example of using the size liquid filter.
     

Share This Page