Welcome to the LimeSurvey Community Forum

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

Add file attachment to email

  • michaelkonja59
  • michaelkonja59's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 2 weeks ago #243028 by michaelkonja59
Add file attachment to email was created by michaelkonja59
Please help us help you and fill where relevant:
Your LimeSurvey version: version 5.4.0
Own server or LimeSurvey hosting: Own server on premise
Survey theme/template: not relevant
==================I have a form with file upload field. In "Edit email template", I design email in "Detailed admin notification".There is an option to add the file as attachment to the email (currently I can see the file name only)?Thanks
Michael

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 2 weeks ago #243073 by DenisChenu
Replied by DenisChenu on topic Add file attachment to email
You don't have the Add file ?

 

Maybe update to  5.6.18 can fix the issue.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 2 weeks ago #243110 by holch
Replied by holch on topic Add file attachment to email
Denis, I think he is talking about the admin notifications, not the invitation, your screenshot is for the invitations.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • michaelkonja59
  • michaelkonja59's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 1 week ago #243180 by michaelkonja59
Replied by michaelkonja59 on topic Add file attachment to email
I would like to clarify my question.

I have a form with "Upload file " field.

In "Notification and data management settings", "Send detailed notification email to:" field, I defined Email address.

In "Edit email templates", "Detailed admin notification", I designed email template as: "File upload: {G00Q03}"

When I receive an email, I can see the file name: "File upload: [{ "title":"","comment":"","size":"206.1318359375","name":"resume.pdf","filename":"fu_98yddzzciz93u9f","ext":"pdf" }]"

I would like to attach the file to the email.

Can I do it?

Thanks
Michael

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243184 by DenisChenu
Replied by DenisChenu on topic Add file attachment to email
Feature request (or plugin)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243189 by Joffm
Replied by Joffm on topic Add file attachment to email
This is not possible.
What you get by {G00Q03} is what is stored in the LimeSurvey database.
But the file itself is not stored in the database but in your installation.
If you investigate the folders of the survey "upoload/surveys/[SurveyID]" you finf in the folder "files" the uploaded files.
 
Unfortunately without extension.

What I'd do:
Rename the file by an ajax call and add the link to the file to your notification.
1. In two equations get the filename and the extension with function "substr"

2. Do the ajax call
Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
     $.post('https://www.myServer/renameFile.php' , { sid: "{SID}", fname: "{eqFname}", ext: "{eqExt}" },function(data) {
     $('#question{QID} input[type="text"]').val(data)
  });
});
</script>

with something like this php script
Code:
<?php
$ssid = $_POST["sid"];
$sfname = $_POST["fname"];
$sExt = $_POST["ext"];
 
$sfullname = '../limesurvey/upload/surveys/'.$ssid.'/files/'.$sfname;
$snewname=$sfullname.'.'.$sExt;
 
$x=rename($sfullname,$snewname);
 
echo $snewname;
?>

Now the file looks like this "fu_178025275761.pdf".


But as @Denis: feature request.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 1 week ago #243193 by DenisChenu
Replied by DenisChenu on topic Add file attachment to email
I think you can update manually DB to add the system.

I think PHP code is ready, maybe just need a GUI system.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose