Narcissistic Project Managers

    tm-notification

    1.0.7 • Public • Published

    tm-notification

    tm-notification - This is the package exposing methods for the notification service

    Installation

    "dependencies"{
      "tm-notification": "~1.0.7" // see the "releases" section
    }

    npm install tm-notification

    Requirements

    • ENV
    APP_NAME=tm-notification-package
    API_GATEWAY_URL=
    NOTIFICATION_SERVICE_URL= //internal microservice
    CLIENT_ID=  

    Send SMS

    const {SMSBuilder} = require('tm-notification');
    const smsBuilder = new SMSBuilder();
    const builder = smsBuilder.startBuild()
                .setRecipients("0703XXXXXXX")
                .setProvider("smpp")
                .setMessage("Test message")
                .setSender("TM30");
     
            const response = await builder.send();
            console.log("Response", response);
        //Response { data: 'Email Sent' }
     

    Send Email

    • To send Email
    const {EmailBuilder} = require('tm-notification');
    const emailBuilder = new EmailBuilder();
    const builder = emailBuilder.startBuild()
        .setProvider("sendgrid")
        .setFrom("package@tm30.net")
        .setSubject("From Test Package")
        .setProvider("sendgrid")
        .setRecipients("michealakinwonmi@gmail.com");
     
    builder.setHeader()
        .setTitle("Header Title")
        // .setBGColor("green")
        .setAppLogo("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png")
        .setAppUrl("https://tm30.net")
        .setAppName("TM30");
     
     
    builder.setBody()
        .setContent("This is a content")
        .setGreeting("Greetings,")
        .setIntroLine([
            "intro line 1",
            "intro line 2"
        ])
        .setOutroLine([
            "outroline 1",
            "outroline 2"
        ]);
     
    builder.setAttachments([
        "https://res.cloudinary.com/tm30global/image/upload/v1582900669/4bb79409937716d8db9855e49cc7a9b6.pdf"
    ]);
    const response = await builder.send();
    console.log("Response", response); //    Response { data: 'Email Sent' }     
     
     
     
     

    Tests

    Cli

    npm install
    npm test

    Contributors

    Install

    npm i tm-notification

    DownloadsWeekly Downloads

    4

    Version

    1.0.7

    License

    ISC

    Unpacked Size

    12.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar