• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Displaying digital signature on email body & on pdf

Guys,

I trust you are all well. I am using a digsig element for my user to sign to accept a service. I am also using a form plug in email to send a confirmation including the signature the just signed. I have 2 issues:

  • On the email (i.e. email body text see attachment 1) when I echo the content of the digsig element I get some coded data and not the signature the user signed. I am sure its the code that I am using to receive the form data. I am using the following code in my php template
$digital_signature = $formModel->getElementData('limits___digital_signature');
echo $digital_signature;​
  • On the pdf attachment to the email the signature also does not display (see attachment 2) is there something that I am missing here
Thanks in advance

Regards
Simon
2. signature not readable on txt HTML.PNG 2. signature not readable on txt HTML.PNG 1. signature not displaying on pdf.PNG
 
I can't replicate
On my site the signature is rendered correctly in all PDFs: list, form, details, email-Plugin in the message (via placeholder) and as attachment.
The error message in your PDF screenshot looks like the signature was generated but this generated image is not accessible on your server.

The element itself contains the coords you are displaying. Fabrik is generating the signature image on the fly.
 
Dear Troester,

Sorry for taking so long before replying but I had taken a break from the project but now I am back full force.

The signature image is displaying perfect in the form and list on the front end, the problem is that it does not display the image2. Signature saved as saved on the DB.PNG when I use the email plugin i.e. in the email that is send out or the PDF that is attached on the email.

You said that the image generated is not accessible from my server. My provider is siteground and I went to the actual table using phpadmin via cpanel and the digital signature field has stored the digital signature but in code see attachment.

The signature is being store correctly (i.e. in code) I think what is not happening (when using email plugin) is converting this code in to the image during display.

Do you have any ideas, I really need the signature to display in the email.

Please assist

Regards
Simon
 
In your first post, you have an image where the PDF generation tries to get the image URL, and has "image type unknown".

Try copying the URL it is using, and pasting it into a browser, and see if it works. Try it both logged in, and not logged in.

-- hugh
 
Hugh,

Thanks for the reply. I have tried to copy the link. When I am logged in the image displays in the browser but when I am not logged in the image does not display, I get a joomla message "
PLG_ELEMENT_DIGSIG_NO_SUCH_FILE" . What does this mean?

I have tried to assigned access rights to that list to "public" to see if that works but it did not. The image still does not display in the email attachment and the code displays on the email body instead of the image

Any ideas on how to fix it?

Regards
Simon
when logged in.PNG when logged off.PNG
 
With that ACL set, does the URL work in the browser?

NO_SUCH_FILE usually means that the row could not be read, usually because of ACL issue.

The problem here is that when the PDF is built, it is built on the server side, not in your browser. The server make a request to itself to fetch the image, and that request does not have your login session - it's a "public" request.

So you have to figure out why that URL is getting access controlled. Do you have an ACL on the element itself?

-- hugh
 
Hugh,

Yes the URL opens the image only when the user related to that record in logged in. If a different user is logged in then the image does not display in the browser

I have checked the List ACL and element ACLs and all of them are set to "public" see attachment. I have not linked the list to a page builder, I connect to this list directly see URL below so there are no ACLs set there either (http://smeboost.com/index.php/component/fabrik/form/index.php?option=com_fabrik&view=list&listid=98)

In the digsig element there is a field "PDF secret". Could it be the cause of this issue? I have set it to a random phrase "signature". I am really out of ideas here. Can I give you credentials to check it out?

Regards
Simon
Element ACL.PNG List ACL.PNG
 

Attachments

  • PDF secret.PNG
    PDF secret.PNG
    83.3 KB · Views: 40
Ooops, I completely forgot I'd added the PDF secret to digsig, for exactly this situation. Or at least, for the situation where you have ACL's preventing anonymous access to the list or the element itself.

So the link the PDF now uses to load the digsig should now have &pdf_secret=signature on the end, correct?

Which should work around any ACL issues. So if it still doesn't work, it's probably something else.

Which means we have to figure out which of the occurences of NO_SUCH_FILE is kicking off (it's kind of a generic msg, used in several places in the code.

So ... try editing ./plugins/fabrik_element/digsig/digsig.php, and find all the occurences of PLG_ELEMENT_DIGSIG_NO_SUCH_FILE, which (if you have the latest code) should be at lines 220, 230 and 268 (althuogh I just noticed the one at 220 has a typo, so it won't be that one). Change those strings to add the line number, like PLG_ELEMENT_DIGSIG_NO_SUCH_FILE_268.

Then run your PDF text again, and see which one gets reported. I suspect it'll be 230, and that the $listModel->getRow() isn't returning anything.

Ah, which suggests a possible cause ... do you have any pre-filters on this list? Like maybe a {$my->id} one?

-- hugh
 
Hugh,
Thanks for the response. Yes you are right I have a pre-filter with {user_id}, when I remove it the signature now displays on the pdf which good progress but not on the body of the email. On the body of the email its still coded. (see attachment)
emai body.PNG PDF now with the image.PNG
On your other queries:
  • Yes there is "&pdf_secret=signature" on the end of the URL
  • I have followed your instructions and the "PLG_ELEMENT_DIGSIG_NO_SUCH_FILE" error is being fired from line 230
Back to the pre-filter, does this mean I can not pre-filter the list. I need the user to see only one record, i.e. their own record then they click on the edit button to edit the form and use the digsig element to append their signature.

Can the filtering thing be fixed?
Is it possible to display the signature image on the body of the email?
I am using this code to out put the signature:

$digital_signature = $formModel->getElementData('limits___digital_signature');
echo $digital_signature;

Thanks for the push

Regards
Simon
 
Hugh,

I managed to call the form I need without going via the list buy using the record ID so that solved the need to filter. Let me go with that for the time being. Thanks for the help

Regards
Simon
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top