@memberjunction/ng-entity-communications 2.42.1 → 2.44.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 +101 -28
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -1,16 +1,17 @@
1
- # Entity Communications Component
1
+ # @memberjunction/ng-entity-communications
2
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.
3
+ This Angular component package provides a user interface for selecting message templates, previewing communications, and sending messages to entity recipients within the MemberJunction framework. It enables users to preview how templates will look when applied to real data before sending communications.
4
4
 
5
5
  ## Features
6
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
7
+ - **Template Selection**: Browse and select from available active message templates
8
+ - **Message Preview**: Preview messages with actual entity data before sending
9
+ - **Multi-recipient Support**: Preview communications for multiple recipients with navigation controls
10
+ - **Dialog Integration**: Includes a dialog wrapper component for easy modal integration
11
+ - **Navigation Controls**: VCR-style controls to browse through multiple preview messages
12
+ - **Template Filtering**: Filter templates based on SQL expressions
13
+ - **Real-time Template Processing**: Integrates with MemberJunction's template engine for dynamic content
14
+ - **Provider Integration**: Works with communication providers like SendGrid
14
15
 
15
16
  ## Installation
16
17
 
@@ -69,7 +70,7 @@ export class YourModule { }
69
70
 
70
71
  ```typescript
71
72
  import { Component } from '@angular/core';
72
- import { EntityInfo, RunViewParams } from '@memberjunction/core';
73
+ import { EntityInfo, Metadata, RunViewParams } from '@memberjunction/core';
73
74
  import { TemplateEntityExtended } from '@memberjunction/templates-base-types';
74
75
 
75
76
  @Component({
@@ -94,11 +95,12 @@ export class CustomerCommunicationComponent {
94
95
  customerEntityInfo: EntityInfo;
95
96
  customerViewParams: RunViewParams;
96
97
 
97
- constructor(private metadataService: YourMetadataService) {
98
- // Initialize entity info
99
- this.customerEntityInfo = metadataService.getEntityInfo('Customers');
98
+ constructor() {
99
+ // Initialize metadata and entity info
100
+ const md = new Metadata();
101
+ this.customerEntityInfo = md.Entities.find(e => e.Name === 'Customers')!;
100
102
 
101
- // Set up view parameters to get active customers
103
+ // Set up view parameters to get active customers who haven't been contacted recently
102
104
  this.customerViewParams = {
103
105
  EntityName: 'Customers',
104
106
  ExtraFilter: 'IsActive = 1 AND LastContactDate < DATEADD(month, -3, GETDATE())',
@@ -162,25 +164,96 @@ This component wraps the preview component in a Kendo dialog window.
162
164
 
163
165
  - `DialogClosed`: EventEmitter<boolean> - Emitted when the dialog is closed (true if confirmed, false if canceled)
164
166
 
167
+ ## Component Features
168
+
169
+ ### Template Loading
170
+ - Templates are loaded with their content from the database
171
+ - Only active templates are shown (based on `IsActive` flag and `ActiveAt` date)
172
+ - Additional filtering can be applied via the `templateFilter` input
173
+ - Template content entities are loaded and associated with each template
174
+
175
+ ### Message Preview Generation
176
+ - Uses the EntityCommunicationsEngineClient to generate previews
177
+ - Integrates with communication providers (e.g., SendGrid)
178
+ - Processes templates against entity data to show real previews
179
+ - Supports both HTML body and subject line templates
180
+ - Runs in preview-only mode without actually sending messages
181
+
182
+ ### Navigation Controls
183
+ - VCR-style navigation buttons (first, previous, next, last)
184
+ - Current position indicator showing "X of Y" messages
185
+ - Buttons are automatically disabled at boundaries
186
+ - Font Awesome icons for navigation buttons
187
+
165
188
  ## Process Flow
166
189
 
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
190
+ 1. **Template Selection Phase**:
191
+ - Component loads all active templates filtered by the `templateFilter` expression
192
+ - User sees a list of available templates
193
+ - Clicking a template moves to the preview phase
194
+
195
+ 2. **Preview Generation Phase**:
196
+ - Selected template is processed against the entity data from `runViewParams`
197
+ - EntityCommunicationsEngineClient generates preview messages for each record
198
+ - Loading indicator shows during processing
199
+
200
+ 3. **Preview Navigation Phase**:
201
+ - User can navigate through all generated preview messages
202
+ - Each preview shows the processed subject and HTML body
203
+ - Back button returns to template selection
204
+
205
+ 4. **Dialog Interaction** (when using window component):
206
+ - OK/Cancel buttons control the dialog
207
+ - DialogClosed event indicates user's choice
173
208
 
174
209
  ## Styling
175
210
 
176
- The component includes basic CSS styling that can be customized or overridden in your application.
211
+ The component includes CSS styling with the following key classes:
212
+ - `.step-1`: Template selection view styling
213
+ - `.step-2`: Preview display view styling
214
+ - `.vcr-controls`: Navigation button container
215
+ - `.template-preview`: Preview content container
216
+ - `.subject-line`: Email subject preview styling
217
+ - `.preview-body`: Email body preview styling
218
+
219
+ These styles can be customized or overridden in your application.
177
220
 
178
221
  ## Dependencies
179
222
 
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
223
+ ### Core Dependencies
224
+ - `@memberjunction/core`: Metadata, entity framework, and view execution
225
+ - `@memberjunction/core-entities`: Entity type definitions including TemplateContentEntity
226
+ - `@memberjunction/global`: Global utilities and event system
227
+ - `@memberjunction/communication-types`: Message types, communication engines, and providers
228
+ - `@memberjunction/entity-communications-base`: EntityCommunicationParams interface
229
+ - `@memberjunction/entity-communications-client`: Client-side communication processing engine
230
+ - `@memberjunction/templates-base-types`: Template engine and extended template types
231
+ - `@memberjunction/ng-container-directives`: Container directive utilities
232
+ - `@memberjunction/ng-shared`: Shared Angular utilities
233
+
234
+ ### Angular Dependencies
235
+ - `@angular/common`: Angular common module (v18.0.2)
236
+ - `@angular/core`: Angular core framework (v18.0.2)
237
+ - `@angular/forms`: Form support (v18.0.2)
238
+ - `@angular/router`: Routing support (v18.0.2)
239
+
240
+ ### Kendo UI Dependencies
241
+ - `@progress/kendo-angular-buttons`: Button components (v16.2.0)
242
+ - `@progress/kendo-angular-dialog`: Dialog/window components (v16.2.0)
243
+ - `@progress/kendo-angular-listbox`: Listbox component (v16.2.0)
244
+ - `@progress/kendo-angular-indicators`: Loading indicators (v16.2.0)
245
+
246
+ ## Important Notes
247
+
248
+ ### Current Limitations
249
+ - The component currently hardcodes the SendGrid provider and Email message type
250
+ - Subject template is hardcoded to 'Test Subject Template'
251
+ - From address is hardcoded in the preview generation
252
+
253
+ ### Future Enhancements
254
+ Consider making the following configurable:
255
+ - Communication provider selection
256
+ - Message type selection
257
+ - From address configuration
258
+ - Subject template selection
259
+ - Support for text body templates in addition to HTML
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-entity-communications",
3
- "version": "2.42.1",
3
+ "version": "2.44.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.42.1",
33
- "@memberjunction/global": "2.42.1",
34
- "@memberjunction/core": "2.42.1",
35
- "@memberjunction/communication-types": "2.42.1",
36
- "@memberjunction/entity-communications-base": "2.42.1",
37
- "@memberjunction/entity-communications-client": "2.42.1",
38
- "@memberjunction/ng-container-directives": "2.42.1",
39
- "@memberjunction/ng-shared": "2.42.1",
32
+ "@memberjunction/core-entities": "2.44.0",
33
+ "@memberjunction/global": "2.44.0",
34
+ "@memberjunction/core": "2.44.0",
35
+ "@memberjunction/communication-types": "2.44.0",
36
+ "@memberjunction/entity-communications-base": "2.44.0",
37
+ "@memberjunction/entity-communications-client": "2.44.0",
38
+ "@memberjunction/ng-container-directives": "2.44.0",
39
+ "@memberjunction/ng-shared": "2.44.0",
40
40
  "tslib": "^2.3.0"
41
41
  },
42
42
  "sideEffects": false