1.6.0 • Published 1 year ago

@notarise-gov-sg/sns-notify-recipients v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

sns-notify-recipients

Send SNS notifications with templates.

Installation

To install with npm, run this in your service directory:

npm install @notarise-gov-sg/sns-notify-recipients

Usage

Import package where required:

import { notifyPdt, notifyVaccine } from "@notarise-gov-sg/sns-notify-recipients";

try {
  /* Notify recipient of PDT */
  interface NotifyPdtProps {
    url: string;
    nric?: string;
    passportNumber: string;
    testData: TestData[];
    validFrom: string; // ISO String
  }
  await notifyPdt(notifyPdtProps);

  /* Notify recipient of Vaccination */
  interface NotifyVaccineProps {
    name: string;
    url: string;
    nric?: string;
    passportNumber: string;
    vaccinations: Vaccination[];
    validFrom: string; // ISO String
    vaccinationEffectiveDate: string; // ISO String
  }
  await notifyVaccine(notifyVaccineProps);

  /* Notify recipient of Health cert for new SPM wallet */
  interface NotifyHealthCertProps {
    version: string; // should be "1.0", "2.0"
    type: string; // should be "VAC", "ART", "PCR"
    url: string;
    expiry: number;// Epoch time
    uin: string;
    relationship?: string;// (Optional) should be "self", "child"
  }
  await notifyHealthCert(notifyHealthCertProps);

} catch (e) {
  errorWithRef(`Notification error: ${e.message}`);
}

Environment Variables

Remember to set the following environment variables:

NOTIFICATION_TOPIC_ARN=arn:aws:sns:ap-southeast-1:000000000000:PLACEHOLDER_SNS_TOPIC
NOTIFICATION_SENDER_NAME=MOH
NOTIFICATION_SENDER_LOGO=""
NOTIFICATION_TEMPLATE_ID=000
HEALTH_CERT_NOTIFICATION_TOPIC_ARN=arn:aws:sns:ap-southeast-1:000000000000:PLACEHOLDER_SNS_TOPIC

Developers/Contributors

  1. Develop on a separate branch.

  2. Raise a PR.

  3. Upon approval, "squash and merge" PR into master branch.

  4. A new release will be automatically published by the workflow in GitHub Actions.

1.6.0

1 year ago

1.6.0-beta.1

1 year ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.3

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago