Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ngx-mailto

anthonynahas3.6kMIT17.0.0TypeScript support: included

Angular library simplifying generation of mailto links with TS

ng, library, angular, material, material design, ssr, select icon, icon picker, icon button, image button

readme

angular-material-extensions's logo

ngx-mailto - Angular library simplifying generation of mailto links with Typescript

npm version npm demo docs: typedoc Join the chat at https://gitter.im/angular-material-extensions/Lobby license

from

ngx-mailto demonstration

to -->

ngx-mailto demonstration

Built by and for developers :heart:

Do you have any question or suggestion ? Please do not hesitate to contact us! Alternatively, provide a PR | open an appropriate issue here

If you like this project, support angular-material-extensions by starring :star: and sharing it :loudspeaker:

Table of Contents

Demo

View all the directives and components in action at https://anthonynahas.github.io/ngx-mailto


Dependencies

  • Angular developed and tested with 15.x

Installation

Now add the library via the angular schematics

ng add ngx-mailto

2. Install via npm. (Alternative)

Now install ngx-mailto via:

npm install --save ngx-mailto

Import the library

If you installed the library via angular schematics, you can skip this step

import { NgxMailtoModule } from 'ngx-mailto'; 

@NgModule({
  declarations: [AppComponent, ...],
  imports: [NgxMailtoModule, ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

Other modules in your application like for lazy loading import NgxMailtoModule into your feature module:

API

 interface Mailto {
  receiver?: string | string[];
  subject?: string;
  cc?: string | string[];
  bcc?: string | string[];
  body?: string;
}

Usage

via service NgxMailtoService

<button class="try-me" mat-raised-button color="primary" (click)="open()">Try Me!</button>

import { Mailto, NgxMailtoService } from 'ngx-mailto';

 emails: string[] = ['your_email@domain.de'];
  cc: string[] = [];
  bcc: string[] = [];
  subject!: string;
  body!: string;

  mailto: Mailto = {
    receiver: this.emails,
    cc: this.cc,
    bcc: this.bcc,
    subject: undefined,
    body: undefined
  };

 constructor(private mailtoService: NgxMailtoService) {
  }


open(): void {
    this.mailtoService.open(this.mailto);
  }

via pipe mailto

<a class="try-me" mat-raised-button color="accent" [href]="this.mailto | mailto">Try me!</a>

Run Demo App Locally

Build the library

$ npm run build:lib

Serve the demo app

$ npm start

Other Angular Libraries


Support


Who is using ngx-mailto? Awesome apps?

  1. Nahaus.de

Are you missing your project or you app? PR me to publish it on the README


jetbrains logo

This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm


License

Copyright (c) 2022 Anthony Nahas. Licensed under the MIT License (MIT)

angular-material-extensions's logo

changelog

16.0.0 (2023-11-04)

Bug Fixes

  • project: updated to angular flex layout (a622cb8)
  • project: updated to angular material (5caead3)
  • project: updated to angular universal (c511e5a)
  • project: updated to angular v16 (8bc6c1e)

3.0.1 (2023-02-21)

Bug Fixes

3.0.0 (2023-02-21)

Bug Fixes

  • project: minor (c0b8550)
  • project: upgraded angular to v15 (88b06e0)
  • project: upgraded material to v15 (f0bd98e)
  • project: upgraded material to v15 (ce0e946)

2.0.1 (2022-10-15)

Bug Fixes

  • project: minor (6249bc0)
  • project: upgraded angular and material (50811aa)
  • project: upgraded angular and material (7b34e5d)

2.0.0 (2022-07-01)

Bug Fixes

  • project: updated reamde (6d525ea)
  • project: updated the README.md (316e525)
  • project: upgraded angular material (5f4c670)
  • project: upgraded angular to the latest version (a573ffc)
  • project: upgraded angular universal (65f5039)
  • project: upgraded angular universal (84b1cbb)
  • project: upgreaded angular to v12 (f96ac18)

1.1.0 (2021-12-04)

Bug Fixes

  • lib: updated the dependencies (e6759a9)
  • lib: updated the dependencies (0afa3f8)
  • project: upgraded angular to the latest version (d308b85)
  • project: upgraded angular to the latest version (e954cc6)

1.0.6 (2021-06-15)

Bug Fixes

  • lib: upgraded angular to v12 (61d416f)

1.0.5 (2021-04-20)

Bug Fixes

  • lib: updated the dependencies (8fa9f89)

1.0.4 (2021-04-15)

Bug Fixes

  • project: updated the dependencies (c4094b4)

1.0.3 (2021-01-18)

1.0.2 (2021-01-18)

1.0.1 (2020-11-30)

1.0.0 (2020-11-26)

Bug Fixes

  • demo: improved the demo app (43cfa4a)
  • lib: added angular cli ghpages package for deploy (1aee14d)
  • lib: added release-it package (7179938)
  • lib: added support of schematics (f3b32f5)
  • lib: improved the compose function (5f826d7)
  • lib: improved the ngx-mailto.service.ts (e692d91)
  • lib: refactor code (51053a6)
  • project: minor (e63a8de)
  • project: minor (4ee79b5)
  • project: minor refactoring (171158f)

Features

  • demo: added angular material (ea0e634)
  • demo: added ngx-markdown package (8b8f132)
  • project: added angular universal support (644588a)
  • project: generated the ngx-mailto library (ceb3308)