Skip to content

Capabilities

MailBridge has two provider lanes: transactional email and marketing email. Each adapter declares what it supports, and unsupported features throw UnsupportedMailbridgeFeature by default.

Use this page to decide which provider should handle each lane and which parts of the common API are available today.

Provider Matrix

ProviderTransactionalHosted TemplatesProvider DataMarketingCampaigns
SendGridYesYesYesContacts + listsCreate/send/schedule/get/delete
Amazon SESYesYesYesNoNo
BrevoYesYesYesSubscribers + listsCreate/send/schedule/get/delete
MailerSendYesYesYesNoNo
ResendYesPartialYesNoNo
PostmarkYesYesYesNoNo
MailchimpYesYesYesAudiences + membersCreate/send/schedule/get/delete
KitNoNoNoSubscribers + tags/forms/sequencesBroadcast create/schedule/get/delete
MailerLiteNoNoNoSubscribers + groupsCreate/schedule/get/delete
MailgunYesYesYesNoNo
MailjetYesYesYesSubscribers + listsCreate/send/schedule/get/delete
LogYesYesYesYesYes
ArrayYesYesYesYesYes

Transactional Features

FeatureCommon APINotes
Raw sendsubject(), html(), text(), send()For simple app-rendered messages.
Laravel Mailablessend(new WelcomeMail($user))Keeps existing Laravel mail classes usable.
Hosted templatestemplate('welcome')Resolves provider-specific ids from config/mailbridge.php.
Direct template idtemplateId('...')Bypasses config mapping for one send.
Provider-specific datadataFor('brevo', [...])Provider data overrides common data() values.
Recipientsto(), cc(), bcc()Normalized address objects.
Sender controlsfrom(), replyTo()Falls back to app mail config where needed.
Attachmentsattach(), attachData()Maps file/raw attachments to provider SDK payloads.
Tags/categoriestag()Provider analytics labels where supported.
Metadatametadata()Safe correlation data for reporting/webhooks.
Provider optionswithProviderOptions()Escape hatch for provider-only settings.
Provider overridetransactional('postmark')Uses one provider for this request.
FallbackwithFallback()Selected/default provider first, configured fallbacks after.
TestingMailBridge::fake()Fake assertions for app tests.

Template Data Strategy

Provider-hosted templates rarely use identical variable names. MailBridge keeps the app workflow stable:

php
MailBridge::transactional()
    ->template('welcome')
    ->to($user->email)
    ->data([
        'name' => $user->name,
        'app_url' => config('app.url'),
    ])
    ->dataFor('brevo', [
        'FIRSTNAME' => $user->name,
    ])
    ->dataFor('mailgun', [
        'first_name' => $user->name,
    ])
    ->send();

Merge rule:

php
finalData = array_replace_recursive(data(), dataFor(selectedProvider))

Provider-specific data wins on key conflicts. Data for unused providers is ignored. During fallback, each attempted provider gets its own merged data.

Marketing Features

FeatureCommon APINotes
Subscribelist('signup')->subscribe($subscriber)Resolves list aliases from config.
Unsubscribelist('signup')->unsubscribe($email)Removes a subscriber from a list/group.
Subscriber lookupgetSubscriber($email)Returns normalized SubscriberRecord or null.
Subscriber deletedeleteSubscriber($email)Deletes the subscriber/contact where supported.
Subscriber dataSubscriber::make()->name()->field()Normalized contact profile data.
Tags/groupsSubscriber::make()->tag()Maps to provider concepts where supported.
Campaign createcreateCampaign(Campaign::make(...))Creates a marketing campaign/broadcast.
Campaign sendsendCampaign($id)Sends immediately where provider supports it.
Campaign schedulescheduleCampaign($id, $when)Schedules a campaign where provider supports it.
Campaign report/getgetCampaign($id)Returns provider campaign details/report data.
Campaign deletedeleteCampaign($id)Deletes a campaign/draft where supported.
Provider overridemarketing('mailerlite')Uses one provider for this request.
FallbackwithFallback()Retries transient provider/network failures only.
TestingMailBridge::fake()Fake assertions for marketing workflows.

For provider-specific mappings and caveats, see Provider Guides.

Campaign Purpose

Campaigns are marketing/broadcast emails sent to a list, group, or audience. Use them for newsletters, launches, and announcements. Use transactional email for one-recipient operational mail such as receipts, login links, and notifications.

Planned Common APIs

AreaStatus
Webhook normalizationPlanned with provider verification first.
Rich campaign reporting normalizationCurrent getCampaign() returns provider data; a normalized report shape can come later.

Capability Checks

php
MailBridge::provider('brevo')->supports('marketing.lists');
MailBridge::provider('postmark')->supports('transactional.templates');

Released under the MIT License.