Send response pdf in email

More
1 year 1 month ago #191474 by rickanderson
Hi All...

Having spent a bit of time trying Denis' plugins 'pdfReport' and 'limeMpdf' (thanks for these and your help throughout the thread Denis) I have not quite been able to achieve what I hoped to do (issues with the resulting PDF report orientation and the inability to overlay images).

I am able to produce the PDF report that I require using 'html2pdf' and would like to re-ask my original question which was whether there is some means within LimeSurvey to attach the resulting PDF file to an email to be sent to an email address supplied via an input box in the survey End Message text (i.e. after the survey has been submitted).

I see 'phpmailer' is listed as a third party plugin - I was wondering whether this be used to do the above and if so, how would I access/reference 'phpmailer' within the survey End Message (or do I have to add php code to one of the theme template files)?

Any suggestions or pointers would be much appreciated.

Cheers...Rick.

Please Log in to join the conversation.

More
1 year 1 month ago #191668 by DenisChenu
Currently pdfReport allow tcpdf (included in LS core) or LimeMpdf : an extra plugin.

Then seem availbale to create a LimeHtml2pdf plugin and update pdfReport to use it ?

Else , for orientation : adding this hack in LimeMpdf or pdfReport : mpdf.github.io/paging/page-size-orientation.html seems easiest then create a new html2pdf plugin …

Same to add a background image to body : mpdf.github.io/css-stylesheets/supported-css.html
(maybe this one can be done in gitlab.com/SondagesPro/coreAndTools/lime...df/style-custom.twig)

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.
The following user(s) said Thank You: rickanderson

Please Log in to join the conversation.

More
1 year 1 month ago #191674 by rickanderson
Thanks for getting back to me Denis.

I returned to my original solution (as per above reply) using html2pdf.js to create the pdf as required (image overlays and landscape orientation) and tried to work out how to email the resulting client-side data URI string. I think I have now managed to convert the data URI string generated via html2pdf.js to a Blob which I send to a php file using ajax - the php file then uses LimeSurvey's phpmailer to send an email with the resulting PDF attached...still needs a little fine-tuning but seems to be providing all the functionality required.

Happy to go into more detail if anyone stumbles across this thread looking for similar functionality. Although I'm not sure that this the optimal solution as I said it seems to be working for me.

Meantime, thanks for all the help with this and to the team for the LimeSurvey app itself!
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
1 year 1 month ago #191692 by DenisChenu
Oh right … you use a javascript solution with html2pdf … totally unrelated to plugin then :).
I'm sure some people can be interested , maybe in manual / workaround/javascript ?

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.
The following user(s) said Thank You: rickanderson

Please Log in to join the conversation.

More
1 year 1 month ago #191712 by rickanderson
Yes...in the end I returned to the Javascript solution as it was producing the PDF formatting I wanted and all that was missing was the email capability.

Although you suggested that hacking your pdfReport and LimeMpdf plugins should be relatively easy, I wasn't confident enough to start messing around with them and although you said you might be able to look into this at a later date I'm was aware that there might not be any budget to pay you for this work.

As I said, happy to go into more detail if anyone thinks it worthwhile although not sure how robust my solution is (others on here may be able to fine tune or optimise??) ;) Let me know if this might be helpful and how would I go about it. Would be nice to be able to contribute to the project in some small way.

Please Log in to join the conversation.

More
1 year 1 day ago - 1 year 1 day ago #192801 by Feorod
Replied by Feorod on topic Send response pdf in email
Hi Denis,

Is it possible to enter more than one email address in the "Send PDF to.." setting of the PDFreport upload question. If so, addresses are separated by comma or semi-colomn ?

Thanx in advance

Eric
Last edit: 1 year 1 day ago by Feorod. Reason: Managed to find the answer to the first question by myself :)

Please Log in to join the conversation.

More
11 months 3 weeks ago #193049 by Feorod
Replied by Feorod on topic Send response pdf in email
Dear Eric,

Yes you can enter more than one email in the setting "Send PDF to...". You can enter TOKEN:ATTRIBUTES (with valid email string, of course) and specific email addresses.

Emails must be separated by semi-column ";"

This is a brilliant function of PdfReport.

Eric
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
11 months 3 weeks ago #193067 by DenisChenu

Feorod wrote: Yes you can enter more than one email in the setting "Send PDF to...". You can enter TOKEN:ATTRIBUTES (with valid email string, of course) and specific email addresses.

Emails must be separated by semi-column ";"

Hi ,

It's noty in the help of this settings ?

Must be …
Please : if not : can you report the issue ? I'm happy to add it…

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.

More
11 months 3 weeks ago #193085 by Feorod
Replied by Feorod on topic Send response pdf in email
Hello Denis,

I read all the short documentation included within the ZIP file and it's not there. There is also no "text in bubble" when hovering the mouse over the text describing this particular setting (almost all other settings of the Upload File question have these "text in bubble" to explain how to fill the setting...).

The configuration settings of PDFreport extension doesn't mention anything about it either. BTW, explanation given there are very nebulous and hard to comprehend. It could be more detailed... with examples !! I had to figure it all by myself, took me a couple of hours to find how PDFreport settings work !!

I would like to report something, but where ?

Thanx Denis for all your LS work, PDFreport is great, just wish I knew how to edit the PDF format (police, margins, etc...) :)

Eric

Please Log in to join the conversation.

More
11 months 3 weeks ago - 11 months 3 weeks ago #193096 by DenisChenu
Issue : gitlab.com/SondagesPro/ExportAndStats/pdfReport/issues
Really need a bubble help

Else : yes extensions.sondages.pro/ update need time …
More time on extensions.sondages.pro/ => Less time to work for client (which allows me to feed my family) or create new plugins …

just wish I knew how to edit the PDF format (police, margins, etc...) :)

You can use HTML editor for this. Inline HTML is readed.

For more css managing : pdfReport can use gitlab.com/SondagesPro/coreAndTools/limeMpdf

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.
Last edit: 11 months 3 weeks ago by DenisChenu.

Please Log in to join the conversation.

More
11 months 3 weeks ago #193099 by Feorod
Replied by Feorod on topic Send response pdf in email
Denis,

Submitted issue. I totally understand the limited amount of time available :)

I will try to tailor the PDF format with HTML editing.

Thanx for all,

Eric
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now