undkonsorten / powermailpdf

When a user fills a powermail form he will get a download link for a pdf file which contains the values he just entered. Also the pdf can be attached to an email and send to the user.
1 stars 7 forks source link

Attach File using TypoScript settings : addAttachment, #1 #2

Closed sypets closed 6 years ago

sypets commented 6 years ago

Suggestion for change: override TypoScript settings addAttachment for setting email attachment.

Use the following TypoScript:

constants

plugin.tx_powermail.settings.receiver.attachment = 1
plugin.tx_powermail.settings.sender.attachment = 1

setup:

plugin.tx_powermail.settings.setup.receiver {
      addAttachment = TEXT
      addAttachment {
        #value = fileadmin/myfile.pdf
        wrap = |
      }  
}
plugin.tx_powermail.settings.setup.sender {
      addAttachment = TEXT
      addAttachment {
        #value = fileadmin/myfile.pdf
        wrap = |
      }  
}
sypets commented 6 years ago

I have put an if-statement in there which makes the change only if powermail version is > 3.22.0. On second thought it would probably make more sense to provide a new version that requires at least TYPO3 7.6 and powermail 4.0.0. I can make the changes to the PR accordingly.

Starkmann commented 6 years ago

Thanks for the pull request. I will have a look on this and test it. As far as i see now it look good to me.

My idea was to make new versions for each typo3 version and then later drop support/new features for older powermail versions <4.0 and typo3 6.2 later. Like this:

powermailpdf 0.4.3 - Typo3 6.2 powermailpdf 1.4.3 - Typo3 7.6 powermailpdf 2.4.3 - Typo3 8.6

Not sure yet if I would need the last version.

Starkmann commented 6 years ago

This feature is now available. Thanks for the pull request.