remp / crm-print-module
CRM Print Module
Installs: 9 524
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- dev-master
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.2.0
- 1.1.0
- 1.0.0
- 1.0.0-beta2
- 1.0.0-beta1
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.1
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.2
This package is auto-updated.
Last update: 2024-10-25 12:18:30 UTC
README
The purpose of Print module is to give you ability to generate exports of users who should receive print version of your newspaper/magazine, keep track of which issues the user got and give you ability to create your own module on top of Print module to integrate with your print delivery provider.
Installing module
We recommend using Composer for installation and update management.
composer require remp/crm-print-module
Enabling module
Add installed extension to your app/config/config.neon
file.
extensions: - Crm\PrintModule\DI\PrintModuleExtension
Run service commands to generate CRM internals:
php bin/command.php phinx:migrate
php bin/command.php user:generate_access
php bin/command.php api:generate_access
php bin/command.php application:seed
Configuration
Directory
Default directory for exports, is APP_ROOT/content/export. Directory is created automatically with first upload.
You can use other buckets for uploads, but you need to define them in your config file app/config/config.neon
:
services: # ... # fileManager extension - example uploads exampleExportsAdapter: League\Flysystem\Local\LocalFilesystemAdapter('%appDir%/../content/examples_exports', null) exampleExportsFileSystem: League\Flysystem\Filesystem(@exampleExportsAdapter) applicationMountManager: setup: - mountFilesystem('exampleExports', @exampleExportsFileSystem)
Using print module
Frontend
Print module adds print
address type. This address type should be use for deliveries of your newspaper/magazines.
Module also adds new content access to the CRM called print
. You can add this content access to selected subscription types and let your customers buy them. If user buys subscription with access to print
, CRM will ask user to enter delivery (print
) address after successful payment.
If for some reason user doesn't enter the address, she's reminded by notification to enter the missing address on every page of customer zone. Administrators are reminded by the list of all people with active print subscription with missing print
address by widget in CRM admin.
You can always replace this widget with your own implementation by overriding the default widget in your custom module:
public function registerWidgets(\Crm\ApplicationModule\Widget\WidgetManagerInterface $widgetManager) { // ... $widgetManager->overrideWidget( 'frontend.layout.top', $this->getInstance(\Crm\PrintModule\Components\EnterAddressWidget::class), $this->getInstance(\Crm\FooModule\Components\EnterAddressWidget::class), 100 ); // ... }
Backend
As every publisher works with different delivery partner which requires data in different format, we only prepared demo command to generate CSV with list of print subscribers that should receive a print edition.
It's recommended for you to create your own implementation of export command in your custom module based on this one altered to match your needs.
The command uses two main concepts:
- DataSource. This should return query containing all the subscriptions that could be used to generate CSV. In our demo data source we select all
print
subscriptions. - View. This is component handling how the subscriptions are actually displayed (exported) into the CSV file. Here you can define what columns the export should have and the actual values with possibility to format them based on your needs. See demo view to see how the CSV is created.
Command is defined in a way that export is generated two working days before the delivery - this is industry standard in our area. If your flow differs, feel free to alter this in your implementation.
You can also see, that command uses print_daily
as a key for export criteria. This is to differentiate between multiple exports as one publisher might have daily delivery of one newspaper and monthly delivery of some magazine. This key is identifying which export is being used. You should therefore have different generation commands for different exports.
The exporting engine is automatically handling print status for every print subscriber. Each generation it flags every customer to give you information whether it's a:
- new subscriber - she'll get the first edition
- recurrent subscriber - she was receiving the newspaper before (e.g. the day before) and she should receive them also today
- removed subscriber - she was receiving the newspaper before (e.g. the day before) and she is not supposed to get the newspaper today.
These flags help to some delivery partners which don't need full list of subscribers every day but they require incremental changes of people who should be added to the list / removed from the list.
Once generated, you can see and download the export in the CRM admin (/print/print-subscriptions-admin/
:
Components
EnterAddressWidget
Simple widget showing warning with missing address.
PaymentSuccessPrintWidget
Widget on subscription success page with address form.
RequestNotification
Address change request list widget.
UserChangeAddressRequests
Listing witget with address change requests.
UserPrintExport
User detail print export lising widget.