Features
Docs
CLI
Benchmarks
Examples

© 2024 MoroJs

@morojs/moro


@morojs/moro / SendGridAdapter

Class: SendGridAdapter

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:14

SendGrid adapter for email sending Supports SendGrid API features

Extends

Constructors

Constructor

new SendGridAdapter(): SendGridAdapter

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:19

Returns

SendGridAdapter

Overrides

BaseMailAdapter.constructor

Properties

config

protected config: any

Defined in: src/core/mail/mail-adapter.ts:11

Inherited from

BaseMailAdapter.config


initialized

protected initialized: boolean = false

Defined in: src/core/mail/mail-adapter.ts:12

Inherited from

BaseMailAdapter.initialized

Methods

close()

close(): Promise<void>

Defined in: src/core/mail/mail-adapter.ts:69

Close adapter connections (optional)

Returns

Promise<void>

Inherited from

BaseMailAdapter.close


ensureInitialized()

protected ensureInitialized(): void

Defined in: src/core/mail/mail-adapter.ts:110

Check if adapter is initialized

Returns

void

Inherited from

BaseMailAdapter.ensureInitialized


getName()

getName(): string

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:194

Get adapter name (must be implemented by subclasses)

Returns

string

Overrides

BaseMailAdapter.getName


initialize()

initialize(config): Promise<void>

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:25

Initialize adapter with configuration

Parameters

config

SendGridConnection

Returns

Promise<void>

Overrides

BaseMailAdapter.initialize


normalizeAddress()

protected normalizeAddress(address): object

Defined in: src/core/mail/mail-adapter.ts:76

Normalize email address

Parameters

address

string | { email: string; name?: string; }

Returns

object

email

email: string

name?

optional name: string

Inherited from

BaseMailAdapter.normalizeAddress


normalizeAddresses()

protected normalizeAddresses(addresses): object[]

Defined in: src/core/mail/mail-adapter.ts:89

Normalize email addresses array

Parameters

addresses

string | string[] | { email: string; name?: string; } | object[]

Returns

object[]

Inherited from

BaseMailAdapter.normalizeAddresses


send()

send(options): Promise<MailResult>

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:49

Send an email (must be implemented by subclasses)

Parameters

options

MailOptions

Returns

Promise<MailResult>

Overrides

BaseMailAdapter.send


sendBulk()

sendBulk(options): Promise<MailResult[]>

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:161

Send multiple emails in bulk Default implementation sends one by one Override for better performance

Parameters

options

MailOptions[]

Returns

Promise<MailResult[]>

Overrides

BaseMailAdapter.sendBulk


verify()

verify(): Promise<boolean>

Defined in: src/core/mail/adapters/sendgrid-adapter.ts:198

Verify adapter connection (optional)

Returns

Promise<boolean>

Overrides

BaseMailAdapter.verify