I created a chart in javascript (chart.js) using values from previous answers. displaying works fine but I would like to attach it to a “send email” action
When I try to use the following custom script I recieve a pdf attachment but it is just one blank page.
%%contents = sgapiGetValue(55); //javascript action ID is 55
%%pdf = sgapiHTMLTOPDF(%%contents);
%%attachment[’filename.pdf’] = %%pdf;
//Attach to existing send email action (ID 108)
sgapiSetQuestionProperty(108,”email_attachments”,%%attachment);
any ideas? thanks a lot!
I am not a PHP scripting expert, but I have used the attach a certificate script in the SurveyGizmo Developer Resources for several different projects. This script creates a certificate that is then attached as a pdf file to an email. The bulk of that script actually builds the HTML file (head, body) that is then converted to a PDF – these are steps that your script seems to lack.
Hope this is helpful!
Could you share the JavaScript action you used to display the chart?