@memberjunction/ng-entity-communications 2.32.2 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +186 -0
  2. package/package.json +9 -9
package/README.md ADDED
@@ -0,0 +1,186 @@
1
+ # Entity Communications Component
2
+
3
+ This Angular component package provides a UI for selecting message templates, previewing communications, and sending messages to entity recipients within the MemberJunction framework.
4
+
5
+ ## Features
6
+
7
+ - **Template Selection**: Browse and select from available message templates
8
+ - **Message Preview**: Preview messages with actual data before sending
9
+ - **Multi-recipient Support**: Preview communications for multiple recipients
10
+ - **Dialog Integration**: Includes a dialog component for easy integration
11
+ - **Navigation Controls**: Browse through multiple preview messages
12
+ - **Template Filtering**: Filter templates based on specific criteria
13
+ - **Customizable**: Extensive configuration options for the component
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @memberjunction/ng-entity-communications
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### Import the Module
24
+
25
+ ```typescript
26
+ import { EntityCommunicationsModule } from '@memberjunction/ng-entity-communications';
27
+
28
+ @NgModule({
29
+ imports: [
30
+ EntityCommunicationsModule,
31
+ // other imports
32
+ ],
33
+ // ...
34
+ })
35
+ export class YourModule { }
36
+ ```
37
+
38
+ ### Basic Component Usage
39
+
40
+ ```html
41
+ <!-- Use the preview component directly -->
42
+ <mj-entity-communications-preview
43
+ [entityInfo]="entityInfo"
44
+ [runViewParams]="runViewParams"
45
+ [templateFilter]="'TemplateType = ''Email''' "
46
+ (templateSelected)="onTemplateSelected($event)">
47
+ </mj-entity-communications-preview>
48
+ ```
49
+
50
+ ### Dialog Component Usage
51
+
52
+ ```html
53
+ <!-- Use the preview in a dialog window -->
54
+ <button kendoButton (click)="showPreviewDialog()">
55
+ Preview Communications
56
+ </button>
57
+
58
+ <mj-entity-communications-preview-window
59
+ *ngIf="previewDialogVisible"
60
+ [entityInfo]="entityInfo"
61
+ [runViewParams]="runViewParams"
62
+ [DialogVisible]="previewDialogVisible"
63
+ [Title]="'Email Preview'"
64
+ (DialogClosed)="onPreviewDialogClosed($event)">
65
+ </mj-entity-communications-preview-window>
66
+ ```
67
+
68
+ ### TypeScript Component Example
69
+
70
+ ```typescript
71
+ import { Component } from '@angular/core';
72
+ import { EntityInfo, RunViewParams } from '@memberjunction/core';
73
+ import { TemplateEntityExtended } from '@memberjunction/templates-base-types';
74
+
75
+ @Component({
76
+ selector: 'app-customer-communication',
77
+ template: `
78
+ <button kendoButton (click)="previewCustomerEmails()">
79
+ Preview Customer Emails
80
+ </button>
81
+
82
+ <mj-entity-communications-preview-window
83
+ *ngIf="showPreview"
84
+ [entityInfo]="customerEntityInfo"
85
+ [runViewParams]="customerViewParams"
86
+ [DialogVisible]="showPreview"
87
+ [Title]="'Customer Email Preview'"
88
+ (DialogClosed)="onPreviewClosed($event)">
89
+ </mj-entity-communications-preview-window>
90
+ `
91
+ })
92
+ export class CustomerCommunicationComponent {
93
+ showPreview = false;
94
+ customerEntityInfo: EntityInfo;
95
+ customerViewParams: RunViewParams;
96
+
97
+ constructor(private metadataService: YourMetadataService) {
98
+ // Initialize entity info
99
+ this.customerEntityInfo = metadataService.getEntityInfo('Customers');
100
+
101
+ // Set up view parameters to get active customers
102
+ this.customerViewParams = {
103
+ EntityName: 'Customers',
104
+ ExtraFilter: 'IsActive = 1 AND LastContactDate < DATEADD(month, -3, GETDATE())',
105
+ OrderBy: 'LastContactDate ASC',
106
+ ResultType: 'entity_object'
107
+ };
108
+ }
109
+
110
+ previewCustomerEmails() {
111
+ this.showPreview = true;
112
+ }
113
+
114
+ onPreviewClosed(confirmed: boolean) {
115
+ this.showPreview = false;
116
+
117
+ if (confirmed) {
118
+ // User confirmed - you could initiate the actual sending here
119
+ console.log('User confirmed sending emails');
120
+ }
121
+ }
122
+
123
+ onTemplateSelected(template: TemplateEntityExtended) {
124
+ console.log('Selected template:', template.Name);
125
+ }
126
+ }
127
+ ```
128
+
129
+ ## API Reference
130
+
131
+ ### EntityCommunicationsPreviewComponent
132
+
133
+ This is the main component for displaying the template selection and preview interface.
134
+
135
+ #### Inputs
136
+
137
+ - `entityInfo`: EntityInfo - Information about the entity for which communications will be sent
138
+ - `runViewParams`: RunViewParams - Parameters for running a view to retrieve entity data
139
+ - `templateFilter`: string - SQL filter expression to filter available templates
140
+
141
+ #### Outputs
142
+
143
+ - `templateSelected`: EventEmitter<TemplateEntityExtended> - Emitted when a template is selected
144
+
145
+ ### EntityCommunicationsPreviewWindowComponent
146
+
147
+ This component wraps the preview component in a Kendo dialog window.
148
+
149
+ #### Inputs
150
+
151
+ - `DialogVisible`: boolean - Controls the visibility of the dialog
152
+ - `Title`: string - Title of the dialog window (default: 'Communications Preview')
153
+ - `Width`: number - Width of the dialog (default: 650)
154
+ - `Height`: number - Height of the dialog (default: 600)
155
+ - `MinWidth`: number - Minimum width of the dialog (default: 400)
156
+ - `MinHeight`: number - Minimum height of the dialog (default: 350)
157
+ - `Resizable`: boolean - Whether the dialog is resizable (default: true)
158
+ - `entityInfo`: EntityInfo - Information about the entity
159
+ - `runViewParams`: RunViewParams - Parameters for running a view
160
+
161
+ #### Outputs
162
+
163
+ - `DialogClosed`: EventEmitter<boolean> - Emitted when the dialog is closed (true if confirmed, false if canceled)
164
+
165
+ ## Process Flow
166
+
167
+ 1. The component displays a list of available templates based on the provided filter
168
+ 2. User selects a template to preview
169
+ 3. The component fetches data using the provided entity and view parameters
170
+ 4. The template is applied to each record in the dataset to generate preview messages
171
+ 5. User can navigate through the preview messages to see how the communication will appear for each recipient
172
+ 6. In a dialog context, user can confirm or cancel the operation
173
+
174
+ ## Styling
175
+
176
+ The component includes basic CSS styling that can be customized or overridden in your application.
177
+
178
+ ## Dependencies
179
+
180
+ - `@memberjunction/core`: For metadata and entity access
181
+ - `@memberjunction/core-entities`: For entity types
182
+ - `@memberjunction/global`: For global utilities
183
+ - `@memberjunction/communication-types`: For message types and interfaces
184
+ - `@memberjunction/entity-communications-base`: For base communication classes
185
+ - `@memberjunction/entity-communications-client`: For client-side communication engine
186
+ - `@memberjunction/templates-base-types`: For template-related interfaces
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-entity-communications",
3
- "version": "2.32.2",
3
+ "version": "2.34.0",
4
4
  "description": "MemberJunction: Angular Components to allow a user to select templates, preview the messages with those tempaltes, and send them",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -29,14 +29,14 @@
29
29
  "@progress/kendo-angular-indicators": "16.2.0"
30
30
  },
31
31
  "dependencies": {
32
- "@memberjunction/core-entities": "2.32.2",
33
- "@memberjunction/global": "2.32.2",
34
- "@memberjunction/core": "2.32.2",
35
- "@memberjunction/communication-types": "2.32.2",
36
- "@memberjunction/entity-communications-base": "2.32.2",
37
- "@memberjunction/entity-communications-client": "2.32.2",
38
- "@memberjunction/ng-container-directives": "2.32.2",
39
- "@memberjunction/ng-shared": "2.32.2",
32
+ "@memberjunction/core-entities": "2.34.0",
33
+ "@memberjunction/global": "2.34.0",
34
+ "@memberjunction/core": "2.34.0",
35
+ "@memberjunction/communication-types": "2.34.0",
36
+ "@memberjunction/entity-communications-base": "2.34.0",
37
+ "@memberjunction/entity-communications-client": "2.34.0",
38
+ "@memberjunction/ng-container-directives": "2.34.0",
39
+ "@memberjunction/ng-shared": "2.34.0",
40
40
  "tslib": "^2.3.0"
41
41
  },
42
42
  "sideEffects": false