2

I want to send the form filled up during registration as an pdf in email attachment.The form is build using lightning component. I didn't find any solution for this. Is this possible in lightning?

2

Your form will have to be renderable to a Visualforce page if you want to do it using native Salesforce functionality. This suggests that depending on how the "form" is created in your component, it will need to be done in one of the following ways:

  1. Captured inside of a "Lightning I-frame" that holds a Visualforce page.
  2. Capture the information using the fields in a regular Lightning Component's form, then pass them into another page via the Component's controller & a VF Controller.
    • The 2nd page would be pure Visualforce/html which uses "renderas=pdf".
    • Use the latter page to render the PDF document you're going to attach to the email.

I'd think #2 would be the better choice.

  • I followed the above approach but the send email method is not getting called from my lightning component. – Debarun Sengupta Aug 14 '17 at 12:11
  • 1
    I created a lightning component and from its controller I called the server side controller where the send email logic is written. Since render as pdf doesn't work in lightning I created a dummy vf page with output fields and passed the record id to that page and attached that pdf page as an email attachment. Thanks for the above idea. – Debarun Sengupta Aug 14 '17 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.