Add email support to your Cordova/Ionic/Web projects.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo Clean up Sep 28, 2018
src
.gitignore Clean up Sep 28, 2018
README.md Updates Sep 27, 2018

README.md

Capacitor Email

Usage

import { Email } from '@teamhive/capacitor-email';

const email = new Email();

const hasPermission = await email.hasPermission();

if(!hasPermission){
    await email.requestPermission();
}

const available = await email.isAvailable({
      alias: 'gmail' // gmail, outlook, yahoo *optional*,
});

// available.hasAccount  *If email is setup*
// available.hasApp  *If device has alias supplied*


if(available.hasAccount){
    email.open({
    to:['me@myemail.com'],
    cc: ['bro@hisemail.com'],
    bcc: ['sis@heremail.com'],
    subject: 'Party',
    body: 'Hi bring drinks...',
    isHtml: false,
    attachments: [SomeFilePath]
    })
}

Api

Method Default Type Description
isAvailable(options?: AvailableOptions) Promise<AvailableResults>
open(options?: EmailOptions) Promise<any>
openDraft() Promise<any>
requestPermission() Promise<any>
hasPermission() Promise<any>
getDefaults() Promise<any>
getAliases() Promise<any>