Since

3.0.3 A standard interface for managing, editing, and sending an email message. When email composer is dismiss, page's onShow will be triggered.

Example

import File from '@smartface/native/io/file';
import FileStream from '@smartface/native/io/filestream';
import EmailComposer from '@smartface/native/ui/emailcomposer';
import System from '@smartface/native/device/system';

if (EmailComposer.canSendMail()) {
var emailcomposer = new EmailComposer();
emailcomposer.setBCC(["bcc@smartface.io","bcc2@smartface.io"]);
emailcomposer.setCC(["cc@smartface.io","cc2@smartface.io"]);
emailcomposer.setTO(["to@smartface.io","to2@smartface.io"]);
emailcomposer.setMessage("message");
emailcomposer.setSubject("subject");
emailcomposer.onClose = function(){
console.log("onClose");
};

var imageFile = new File({
path: 'assets://smartface.png'
});

emailcomposer.android.addAttachmentForAndroid(imageFile);

if (System.OS == "iOS") {
var imageFileStream = imageFile.openStream(FileStream.StreamType.READ, FileStream.ContentMode.BINARY);
var fileBlob = imageFileStream.readToEnd();
imageFileStream.close();
emailcomposer.ios.addAttachmentForiOS(fileBlob,"image/png","smartface.png");
}

emailcomposer.show(page);
}

Hierarchy

  • NativeMobileComponent<any, MobileOSProps<EmailComposerIOSProps, EmailComposerAndroidProps>>
    • Emailcomposer

Properties

_nativeObject: any
onClose: (() => void)

Type declaration

    • (): void
    • This function will be triggered when email composer is closed.

      Android

      Ios

      Method

      onClose

      Since

      3.0.3

      Returns void

Accessors

  • get nativeObject(): any
  • Returns any

  • set nativeObject(value: any): void
  • Parameters

    • value: any

    Returns void

  • get ios(): TProps["ios"]
  • Returns TProps["ios"]

  • get android(): TProps["android"]
  • Returns TProps["android"]

Constructors

  • Parameters

    • params: Partial<MobileOSProps<EmailComposerIOSProps, EmailComposerAndroidProps>> = {}

    Returns Emailcomposer

Methods

  • Parameters

    • Optional params: Partial<Record<string, any>>

    Returns void

  • Parameters

    • props: Partial<EmailComposerAndroidProps>

    Returns void

  • Parameters

    • props: Partial<EmailComposerIOSProps>

    Returns void

  • Sets the initial recipients to include in the email’s “CC” field.

    Android

    Ios

    Method

    setCC

    Since

    3.0.3

    Parameters

    • cc: string[]

    Returns void

  • Sets the initial recipients to include in the email’s “BCC” field.

    Android

    Ios

    Method

    setBCC

    Since

    3.0.3

    Parameters

    • bcc: string[]

    Returns void

  • Sets the initial recipients to include in the email’s “TO” field.

    Android

    Ios

    Method

    setTO

    Since

    3.0.3

    Parameters

    • to: string[]

    Returns void

  • Sets the initial body text to include in the email composer.

    Android

    Ios

    Method

    setMessage

    Since

    3.0.3

    Parameters

    • text: string
    • Optional isHtmlText: boolean

    Returns void

  • Sets the initial text for the subject line of the email composer.

    Android

    Ios

    Method

    setSubject

    Since

    3.0.3

    Parameters

    • subject: string

    Returns void

  • This function shows email composer on the given UI.Page.

    Android

    Ios

    Method

    show

    Since

    3.0.3

    Parameters

    • page: PageImpl

      This is the page that email will be shown.

    Returns void

  • Returns void

Generated using TypeDoc