1.0.3 • Published 1 year ago

@unisyn/notify-client v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Notification Service Client

Usage

# build
npm run build

# run
npm run dev
Queue TypeChannel/Topic NamePub/SubPinpointDestinationNotify Type IndexStatus
standardsmsxxSMS3Done
standardsms_templatexxSMS3Done
standardpush_dataxxPUSH1Done
standardpush_data_templatexxPUSH1To Do
standardpushxxPUSH1Done
standardpush_templatexxPUSH1To Do
standardmailxxMAIL2Done
standardmail_templatexxMAIL2Done
standardin_appxxINAPP4To Do
Category idCategory NameStatus
1Announcementactive
2Remindersactive
3System Messagesactive
4Campaignsactive

Queue Data Models

PUSH

FieldData TypeDefault ValueDefault InRelationIs RequiredDetails
application_idstringENVOptionalApplication ID of Pinpoint
actionstringENVOptionalExtra Params URL, OPEN_APP, DEEP_LINK
imagestringENVOptionalHeader image for push notification
iconstringENVOptionalLogo/Icon image for push notification
datamapstringstringOptionalEx. Data : {"type_of": "alarm","page": "booster"}
prioritystringhighENVOptionalnormal, high
destinationstringRequiredNotification Token
titlestringRequiredTitle of Push Notification
messagestringRequiredMessage Body Push Notification
urlstringENVOn Action:URLOptionalonClick URL
# Pub/Sub Payload
{
  "application_id": "PINPOINT_APP_ID",
  "action": "URL",
  "image": "HEADER_IMAGE_URL",
  "icon": "ICON_URL",
  "data": {
    "type_of": "alarm",
    "page": "booster"
  },
  "priority": "high",
  "destination": "NOTIFICATION_TOKEN",
  "title": "Message Title",
  "message": "Message Content ",
  "url": "http://webpage.net"
}

# About Priority
# normal - The notification might be delayed. Delivery is optimized for battery usage on the recipient's device. Use this value unless immediate delivery is required.
# high - The notification is sent immediately and might wake a sleeping device.
# Amazon Pinpoint specifies this value in the FCM priority parameter when it sends the notification message to FCM.
# The equivalent values for Apple Push Notification service (APNs) are 5, for normal, and 10, for high. If you specify an APNs value for this property,
# Amazon Pinpoint accepts and converts the value to the corresponding FCM value

PUSH With Template

# In Progress

E-MAIL custom

FieldData TypeDefault ValueDefault InIs RequiredDetails
application_idstringIn EnvENVOptionalApplication ID of Pinpoint
sender_idstringIn EnvENVOptionalE-mail Sender ID
message_typestringTRANSACTIONALENVOptionalExtra Params TRANSACTIONAL, PROMOTIONAL
destinationstringRequiredReceiver e-mail address
subjectstringRequiredMAIL content
messagestringRequiredMAIL content
# Pub/Sub Payload
{
  "application_id": "PINPOINT_APP_ID",
  "sender_id": "no-reply@unisyn.app",
  "message_type": "TRANSACTIONAL",
  "destination": "sercan@unisyn.app",
  "subject": "MAIL_SUBJECT",
  "message": "MAIL_CONTENT"
}

E-MAIL with template

FieldData TypeDefault ValueDefault InIs RequiredDetails
application_idstringIn EnvENVOptionalApplication ID of Pinpoint
sender_idstringIn EnvENVOptionalSMS Sender ID or Header
message_typestringTRANSACTIONALENVOptionalExtra Params TRANSACTIONAL, PROMOTIONAL
destinationstringRequiredPhone number
template_namestringRequiredTemplate Name welcome, pass reset, etc...
placeholdersstringRequiredPlaceholders for template
# Pub/Sub Payload
{
  "application_id": "PINPOINT_APP_ID",
  "sender_id": "no-reply@unisyn.app",
  "message_type": "TRANSACTIONAL",
  "destination": "sercan@unisyn.app",
  "template_name": "mail_welcome",
  "placeholders": {
    "Name": "Sercan",
    "Surname": "REYHANLI"
  }
}

SMS Normal

FieldData TypeDefault ValueDefault InIs RequiredDetails
application_idstringIn EnvENVOptionalApplication ID of Pinpoint
sender_idstringIn EnvENVOptionalSMS Sender ID or Header
destinationstringRequiredPhone number
message_typestringTRANSACTIONALENVRequiredExtra Params TRANSACTIONAL, PROMOTIONAL
messagestringRequiredSMS content
# Pub/Sub Payload
{
  "application_id": "PINPOINT_APP_ID",
  "sender_id": "+90532165xxXX",
  "message_type": "TRANSACTIONAL",
  "destination": "+90532165xxXX",
  "message": "Message Content"
}

SMS With Template

FieldData TypeDefault ValueDefault InIs RequiredDetails
application_idstringIn EnvENVOptionalApplication ID of Pinpoint
sender_idstringIn EnvENVOptionalSMS Sender ID or Header
destinationstringRequiredPhone number
message_typestringTRANSACTIONALENVRequiredExtra Params TRANSACTIONAL, PROMOTIONAL
template_namestringRequiredTemplate Name welcome, pass reset, etc...
placeholdersstringRequiredPlaceholders for template
# Pub/Sub Payload
{
  "application_id": "PINPOINT_APP_ID",
  "sender_id": "+90532165xxXX",
  "message_type": "TRANSACTIONAL",
  "destination": "+90532165xxXX",
  "template_name": "welcome_message",
  "placeholders": {
    "FirstName": [
      "Sercan !"
    ],
    "LastName": [
      "REYHANLI"
    ]
  }
}

ENV KEYS

# Used Keys

## PUSH
PUSH_QUEUE_DATA: "push_data"
PUSH_QUEUE_DATA_TEMPLATE: "push_data_template"
PUSH_QUEUE_NOTIFY: "push"
PUSH_QUEUE_NOTIFY_TEMPLATE: "push_template"

## SMS
SMS_QUEUE_NORMAL: "sms"
SMS_QUEUE_NORMAL_TEMPLATE: "sms_template"
SMS_QUEUE_OTP: "otp_sms"
SMS_QUEUE_OTP_TEMPLATE: "otp_sms_template"

## MAIL
MAIL_QUEUE_NORMAL: "mail"
MAIL_QUEUE_NORMAL_TEMPLATE: "mail_template"
MAIL_QUEUE_OTP: "otp_mail"
MAIL_QUEUE_OTP_TEMPLATE: "otp_mail_template"
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago