Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Are we able to view uploaded files within the notification email?

  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago #122874 by DOwen
Hi all,

We would like to see any files uploaded using the Upload File question to appear inside the notification email, preferably as an attachment or a link to the actual document. At the moment, we have entered the {value } for each question inside the notification email template, including the upload file question. However, it simply generates the following:

[{ "title":"Test Doc","comment":"","size":"28.16","name":"Lorem%20ipsum%20-%20test.doc","filename":"fu_3wkjcufh8wvy8s3","ext":"doc" }]

Is there any way that we can actually view the document from within the email and not through the LimeSurvey response page? Not all staff will have access to LimeSurvey itself and need to see the results and view/download the documents.

At the moment we have LimeSurvey set up with ConnectWise, I'm not sure if this makes a difference.

Thanks and looking forward to your support!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #122882 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago #122884 by DOwen
Thanks for this!

I saw the second post already but didn't realise it was relevant.

The other post suggests that I can only display a link which is fine. I'm guessing that inserting the code offered in the forum post will need to be pasted into the appropriate email and will then display a link?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #122890 by tpartner
Try something like this for a complete link in the notification email:

Code:
File uploaded: <a href="https://example.com/limesurvey/upload/surveys/{SID}/files/{stristr(str_replace('filename":"', '', stristr(upload1, 'filename":"')), '"', 'true')}">{stristr(str_replace('name":"', '', stristr(upload1, 'name":"')), '"', 'true')}</a>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago #122894 by DOwen
Hi thanks for this, although it hasnt worked. It looks like its also muddled up the HTML as I'm seeing code everywhere after the 'File uploaded' section.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #122896 by tpartner
I tested and it works for me when the mail is received in Outlook 2013.

Can you give a screenshot of your muddled HTML?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago - 9 years 3 months ago #122898 by DOwen
Bare in mind this is coming through to us via ConnectWise...

Last edit: 9 years 3 months ago by DOwen. Reason: Editedlink
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #122900 by tpartner
Sorry, I have no idea what's causing that.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago - 9 years 3 months ago #122921 by DOwen
OK I've made a little bit of progress. I've attached another image. I'm not that familiar with JS, so do I change the example.com link to something else as its appearing in the email?

There's also some unusual behaviour which is difficult to describe. I have 3 faux-groups of questions (all in one question group, but 1 of 3 different sets of questions appear depending on the answer to the first question), so I've repeated the link code you gave me three times, adjusting the curly bracket code on each one. However after saving the email template, it seems to completely remove the whole 2nd section, almost as if its caused by the link code.

Last edit: 9 years 3 months ago by DOwen.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago - 9 years 3 months ago #122930 by tpartner

I'm not that familiar with JS, so do I change the example.com link to something else as its appearing in the email?

There is no JavaScript here. You will need to replace example.com/limesurvey with the path to your LimeSurvey installation.

There's also some unusual behaviour which is difficult to describe...

Can you post the complete source code from the email template?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 3 months ago by tpartner.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 3 months ago #122939 by DOwen
Aha sorry misunderstood that! I've tried using our installation path, but getting an Object Not Found error page when I click the now appearing link.

I've attached two files, one containing the original source code that I'm entering, and another containing the source code after I've clicked save and/or logged back into admin after receiving the emails. As it appears to be changing quite a bit.

Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #122941 by tpartner
I don't know why your editor is doing that. Try disabling the editor (Edit personal preferences --> HTML editor mode --> Popup HTML editor) and saving the source code again.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose