The SilverStripe mailable files module allows you to create a form with checkboxes in which users can select which files they want to receive by email.
- SilverStripe ^4.0
- PHP >= 7.4, >= 8.0
Install the module using composer.
composer require violet88/silverstripe-mailable-files
The module includes 2 extensions that need to be added to the desired page class and the corresponding page controller class.
---
name: extensions
---
Page:
extensions:
- Violet88\MailableFilesModule\DataExtensions\MailableFilesPageExtension
PageController:
extensions:
- Violet88\MailableFilesModule\DataExtensions\MailableFilesPageControllerExtension
After adding the extensions to the page and page controller classes, a new tab will be added to the page CMS interface. In this tab you can add files that can be selected by the user in the form.
The form can be added to the page template using the following code.
<body>
...
$MailableFilesForm
...
</body>