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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-pss-sendgrid-v1

v0.0.1

Published

The PSS Sendgrid library is an internal library made to be integrated into angular applications. It offers client applications the ability to send data to the emailAPI of PSSG

Downloads

4

Readme

PSS Sendgrid Library

The PSS Sendgrid library is an internal library made to be integrated into angular applications. It offers client applications the ability to send data to the emailAPI of PSSG

Prerequisites

Installation and Setup

npm install ngx-pss-sendgrid

Setup

include the following in your module.ts file

...
import { NgxPssSendgridModule } from 'ngx-pss-sendgrid';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    NgxPssSendgridModule.forRoot(environment.SendgridUrl)
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

In your enviroment variables, configure these following lines


export const environment = {
  production: false,
  ...
  SendgridUrl: {
    sendgridAPI: "SERVERLESS_API",
    sendgridEmail: "WEBSITE_EMAIL",
    emailSubject: "EMAIL_SUBJECT",
    siteName: "WEBSITE_NAME"
  },
  ...
};

There are two ways to use the library. The Basic Usage provides you with a basic form and the Advanced Usage allows you to configure your own form and use the library's service to send data.

The Basic Usage

include the following line where you want to use the form inside your app.component.html file OR any .html file

<lib-ngx-pss-sendgrid formTitle="YOUR_FORM_TITLE"></lib-ngx-pss-sendgrid>

You will need to add bootstrap cdn css and javascript for the default view of the form inside your index.html, add the following lines:

<!doctype html>
<html lang="en">
<head>
  ...
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
  ...
</head>
<body>
  <app-root></app-root>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-ODmDIVzN+pFdexxHEHFBQH3/9/vQ9uori45z4JjnFsRydbmQbmL5t1tQ0culUzyK" crossorigin="anonymous"></script>
</body>
</html>

The Advanced Usage

You have to follow a certain standard to get the desired results from this library. The following diagram shows the required properties when using this library inside your app.component.ts file OR any .ts file

...
import { NgxPssSendgridService } from 'ngx-pss-sendgrid';
...

export class ExampleComponent implements OnInit {
    ...
    constructor(private service: NgxPssSendgridService) {}
    ...

    onBtnSubmit(formValues) {
        this.service.sendEmail(formValues).subscribe({
            ...
        })
    }
}

The formValues json object must include "userEmail" and "content" for the library to work. When using this method, you can send additional json key-value pairs inside the formValues to save additional metadata fields

An example Json Object

{
  userEmail: "THE EMAIL OF END USER", //REQUIRED
  content: "THE CONTENT SENT BY END USER", //REQUIRED
  ... //Additional optional fields here
}

It is the responsibility of the client application to create the HTML format of the sent data