Saturday, June 3, 2017

TYPO3: Extending Powermail with New Fields & Conditions with working example to generate PDF File in Frontend.

Powermail is a most powerful editor-friendly, easy to use mailform extension with a lots of features like spam prevention, marketing information, optin, ajax submit, diagram analysis.

Here in this blog i'll explain with an example how to extend Powermail extension in Frontend. Development version is with 3.19.0 - stable. This example should work with other lower versions as its based on Extbase and Fluid Template Engine.

To make this example more usable and demanding i am going to add a new feature to it. 
Sometimes we require to generate PDF file with the posted data in the Powermail Form. Say  for example you want a form where Frontend Users/ Website Visitors will fill the form and generate a PDF and sign it and upload it again to the server and Send it. i.e. Workflow is like 
Form >> Generate PDF by clicking on Generate PDF file with the filled values ( but no submit) >> Print and Sign the PDF then Upload >> Submit the whole form. 

We can easily add more steps to this flow or can eliminate any step from here.
Now lets begin with the main matters.
Extension "nirmalya_powermailpdf" has extended Powermail with two additional database fields for form field File and Submit.Those are "signedpdf" to store generated PDF File and "signedpdfbutton" to tell on clicking on which button to generate PDF File.
 To Generate PDF File i've used Javascrpt library i.e. jspdf. 
More technically there is no php code logic to generate PDF.
By using this library PDF File generation has became super fast!!!
Adding some screenshot from Backend while creating fields for a Powermail Form.
Submit Filed extended with a checkbox to set whether its PDF File Creation button or not.

File Field extended with a checkbox whether it's to store Generated PDF File or not.

Please Fork this extension from GitHub and use it - extend it - customize it as per your need. I am also happy to hep you more on your requirements.

GitHub: https://github.com/nirmalyamondal/TYPO3-Extensions/tree/master/nirmalya_powermailpdf/

Monday, April 10, 2017

Drupal 8 - Restricting a node content type with access token from viewing.

Now i'll share a Module to alter the existing Drupal "Site Information" form. Specifics:
  • A new form text field named "Site API Key" needs to be added to the "Site Information" form with the default value of “No API Key yet”.
  • When this form is submitted, the value that the user entered for this field should be saved as the system variable named "siteapikey".
  • A message should inform the user that the Site API Key has been saved with that value.
  • When this form is visited after the "Site API Key" is saved, the field should be populated with the correct value.
  • The text of the "Save configuration" button should change to "Update Configuration".
  • This module also provides a URL that responds with a JSON representation of a given node with the content type "page" only if the previously submitted API Key and a node id (nid) of an appropriate node are present, otherwise it will respond with "access denied".
This Drupal Module is available here at GitHub.
https://github.com/nirmalyamondal/Drupal-Modules/tree/master/site_apikey