npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memberjunction/ng-entity-communications

v5.31.0

Published

MemberJunction: Angular Components to allow a user to select templates, preview the messages with those tempaltes, and send them

Readme

@memberjunction/ng-entity-communications

Angular components for selecting message templates, previewing communications with live entity data, and sending messages to recipients within the MemberJunction framework.

Overview

The @memberjunction/ng-entity-communications package provides a two-step communication workflow: first, users browse and select from available message templates; then they preview how those templates render against actual entity data before sending. The package includes both an inline preview component and a dialog wrapper for modal presentation.

flowchart TD
    subgraph Phase1["Template Selection"]
        TS[Browse Active Templates] --> TF[Apply Template Filter]
        TF --> TC[User Selects Template]
    end

    subgraph Phase2["Preview & Send"]
        TC --> PG[Generate Previews]
        PG --> NAV[Navigate Messages]
        NAV --> SEND[Confirm / Cancel]
    end

    subgraph Integration["MJ Integration"]
        ECC[EntityCommunicationsEngineClient] --> PG
        RV[RunView - Entity Data] --> PG
        TE[Template Engine] --> PG
    end

    style Phase1 fill:#2d6a9f,stroke:#1a4971,color:#fff
    style Phase2 fill:#7c5295,stroke:#563a6b,color:#fff
    style Integration fill:#2d8659,stroke:#1a5c3a,color:#fff

Installation

npm install @memberjunction/ng-entity-communications

Usage

Import the Module

import { EntityCommunicationsModule } from '@memberjunction/ng-entity-communications';

@NgModule({
  imports: [EntityCommunicationsModule]
})
export class YourModule { }

Inline Preview Component

<mj-entity-communications-preview
  [entityInfo]="entityInfo"
  [runViewParams]="runViewParams"
  [templateFilter]="'TemplateType = ''Email'''"
  (templateSelected)="onTemplateSelected($event)">
</mj-entity-communications-preview>

Dialog Component

@if (showPreview) {
  <mj-entity-communications-preview-window
    [entityInfo]="customerEntityInfo"
    [runViewParams]="customerViewParams"
    [DialogVisible]="showPreview"
    [Title]="'Customer Email Preview'"
    (DialogClosed)="onPreviewClosed($event)">
  </mj-entity-communications-preview-window>
}

Complete Example

import { Component } from '@angular/core';
import { EntityInfo, Metadata, RunViewParams } from '@memberjunction/core';
import { TemplateEntityExtended } from '@memberjunction/templates-base-types';

@Component({
  selector: 'app-customer-communication',
  template: `
    <button (click)="showPreview = true">Preview Customer Emails</button>

    @if (showPreview) {
      <mj-entity-communications-preview-window
        [entityInfo]="customerEntityInfo"
        [runViewParams]="customerViewParams"
        [DialogVisible]="showPreview"
        [Title]="'Customer Email Preview'"
        (DialogClosed)="onPreviewClosed($event)">
      </mj-entity-communications-preview-window>
    }
  `
})
export class CustomerCommunicationComponent {
  showPreview = false;
  customerEntityInfo: EntityInfo;
  customerViewParams: RunViewParams;

  constructor() {
    const md = new Metadata();
    this.customerEntityInfo = md.Entities.find(e => e.Name === 'Customers')!;
    this.customerViewParams = {
      EntityName: 'Customers',
      ExtraFilter: 'IsActive = 1',
      OrderBy: 'LastContactDate ASC',
      ResultType: 'entity_object'
    };
  }

  onPreviewClosed(confirmed: boolean) {
    this.showPreview = false;
    if (confirmed) {
      console.log('User confirmed sending emails');
    }
  }
}

API Reference

EntityCommunicationsPreviewComponent (mj-entity-communications-preview)

Main component for template selection and message preview.

Inputs

| Input | Type | Description | |-------|------|-------------| | entityInfo | EntityInfo | Entity metadata for the communication recipients | | runViewParams | RunViewParams | Parameters for loading entity data | | templateFilter | string | SQL filter expression for available templates |

Outputs

| Output | Type | Description | |--------|------|-------------| | templateSelected | EventEmitter<TemplateEntityExtended> | Emitted when a template is selected |

EntityCommunicationsPreviewWindowComponent (mj-entity-communications-preview-window)

Dialog wrapper around the preview component.

Inputs

| Input | Type | Default | Description | |-------|------|---------|-------------| | DialogVisible | boolean | - | Controls dialog visibility | | Title | string | 'Communications Preview' | Dialog title | | Width | number | 650 | Dialog width in pixels | | Height | number | 600 | Dialog height in pixels | | MinWidth | number | 400 | Minimum dialog width | | MinHeight | number | 350 | Minimum dialog height | | Resizable | boolean | true | Whether the dialog can be resized | | entityInfo | EntityInfo | - | Entity metadata | | runViewParams | RunViewParams | - | View parameters for data loading |

Outputs

| Output | Type | Description | |--------|------|-------------| | DialogClosed | EventEmitter<boolean> | true if confirmed, false if canceled |

Process Flow

  1. Template Selection -- Component loads active templates filtered by the templateFilter expression. User browses and selects a template.
  2. Preview Generation -- The selected template is processed against entity data from runViewParams using EntityCommunicationsEngineClient. A loading indicator shows during processing.
  3. Preview Navigation -- VCR-style controls (first, previous, next, last) let the user browse through all generated preview messages, viewing processed subject lines and HTML bodies.
  4. Confirmation (dialog mode) -- OK/Cancel buttons control the dialog, with DialogClosed emitting the user's choice.

Dependencies

Runtime Dependencies

| Package | Description | |---------|-------------| | @memberjunction/core | Metadata, entity framework, view execution | | @memberjunction/core-entities | Entity type definitions | | @memberjunction/global | Global utilities and event system | | @memberjunction/communication-types | Message types and communication engine interfaces | | @memberjunction/entity-communications-base | EntityCommunicationParams interface | | @memberjunction/entity-communications-client | Client-side communication processing engine | | @memberjunction/templates-base-types | Template engine and extended template types | | @memberjunction/ng-container-directives | Container directive utilities | | @memberjunction/ng-shared | Shared Angular utilities | | @memberjunction/ng-shared-generic | Shared generic components |

Peer Dependencies

  • @angular/common ^21.x
  • @angular/core ^21.x
  • @angular/forms ^21.x
  • @angular/router ^21.x
  • @progress/kendo-angular-buttons ^22.x
  • @progress/kendo-angular-dialog ^22.x
  • @progress/kendo-angular-listbox ^22.x
  • @progress/kendo-angular-indicators ^22.x

Build

cd packages/Angular/Generic/entity-communication
npm run build

License

ISC