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

More
2 years 2 months ago #122874 by DOwen
DOwen created the topic: Are we able to view uploaded files within the notification email?
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!

Please Log in to join the conversation.

More
2 years 2 months ago #122882 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
2 years 2 months ago #122884 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
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?

Please Log in to join the conversation.

More
2 years 2 months ago #122890 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?
Try something like this for a complete link in the notification email:

File uploaded: <a href="http://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.

Please Log in to join the conversation.

More
2 years 2 months ago #122894 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
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.

Please Log in to join the conversation.

More
2 years 2 months ago #122896 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?
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.

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #122898 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
Bare in mind this is coming through to us via ConnectWise...

Last Edit: 2 years 2 months ago by DOwen. Reason: Editedlink

Please Log in to join the conversation.

More
2 years 2 months ago #122900 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?
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.

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #122921 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
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: 2 years 2 months ago by DOwen.

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #122930 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?

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: 2 years 2 months ago by tpartner.

Please Log in to join the conversation.

More
2 years 2 months ago #122939 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
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!
Attachments:

Please Log in to join the conversation.

More
2 years 2 months ago #122941 by tpartner
tpartner replied the topic: Are we able to view uploaded files within the notification email?
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.

Please Log in to join the conversation.

More
2 years 2 months ago #122947 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
Aha this helped! This also allowed me to make some formatting changes. Now its a case of formatting the email to our taste. It's a shame I can't set it to only show the questions that were answered.

I still can't get the attached file to work though, the link is there but I think I may have the installation path wrong.

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #122964 by DOwen
DOwen replied the topic: Are we able to view uploaded files within the notification email?
Also, I have the same file link script (the one you gave) within the HTML 3 times as there are 3 questions (each one only appearing once at a time), and for some reason, the third script fails to work and just displays:

File uploaded: {stristr(str_replace('name":"', '', stristr(Upload1, 'name":"')), '"', 'true')}

I'm not having much luck!

EDIT: And another issue! The multiple choice check box answers are failing to show and end up displaying the curly bracket code inside a yellow box with red border.
Last Edit: 2 years 2 months ago by DOwen.

Please Log in to join the conversation.

More
2 years 2 months ago #122974 by DenisChenu
DenisChenu replied the topic: Are we able to view uploaded files within the notification email?
For complex report in last email, i always use a hidden question (show text question) and for email content:

{QUESTION.question}

It work good and more easily (and with full index you can test without sending email).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now