napoleon/omnismtp-sendgrid

Sendgrid driver for SMTP processing library

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/napoleon/omnismtp-sendgrid

0.2 2020-08-25 08:14 UTC

This package is auto-updated.

Last update: 2025-09-09 00:17:17 UTC


README

Build Status

Installation

composer require napoleon/omnismtp-sendgrid

How to use

Single Recipients

<?php

$key = 'api-key';

$sendgrid = \OmniSmtp\OmniSmtp::create(\Napoleon\OmniSmtp\SendGrid::class, $key);

$sendgrid->setSubject('The Mail Subject')
    ->setFrom('napoleon@example.com')
    ->setRecipients('testemail1@example.com')
    ->setContent('<p>Hello From SendGrid OmniMail</p>')
    ->send();

Multiple Recipients

<?php

$key = 'api-key';

$sendgrid = \OmniSmtp\OmniSmtp::create(\Napoleon\OmniSmtp\SendGrid::class, $key);

$sendgrid->setSubject('The Mail Subject')
    ->setFrom('napoleon@example.com')
    ->setRecipients('testemail1@example.com', 'testemail2@example.com')
    ->setContent('<p>Hello From SendGrid OmniMail</p>')
    ->send();