mailofly 0.2.0 copy "mailofly: ^0.2.0" to clipboard
mailofly: ^0.2.0 copied to clipboard

Official Dart client for the Mailofly REST API (one-off compose, contacts, templates, campaigns, and more).

mailofly #

pub package

Official Dart / Flutter client for the Mailofly REST API.

Source of truth: developed in the mailofly monorepo under packages/dart. This public repo is mirrored automatically on change.

Requirements #

  • Dart 3.0 or newer (Flutter compatible).

Install #

dependencies:
  mailofly: ^0.2.0
dart pub add mailofly

Usage #

Create a client with your API key from User → API keys:

import 'package:mailofly/mailofly.dart';

Future<void> main() async {
  final client = Mailofly(apiKey: 'mf_live_…');

  try {
    final identities = await client.identities.list();
    print(identities['data']);

    await client.emails.send(
      from: 'Acme <onboarding@example.com>',
      to: 'you@example.com',
      subject: 'Hello',
      html: '<p>Thanks for signing up.</p>',
    );
  } on MailoflyException catch (e) {
    print('${e.statusCode} ${e.error} ${e.message}');
  } finally {
    client.close();
  }
}

Discovery (no API key) #

final meta = await Mailofly.discovery();
print(meta['resources']);

Resources #

API Dart
Identities client.identities.list(), get, update, delete
Accounts (deprecated alias for client.identities)
Contacts client.contacts.list(segmentId: …), create, get, update, delete
Templates client.templates.list(), …
Segments client.segments.list(), … plus client.segments.contacts(id).list/add/remove
Campaigns client.campaigns.list(), …, runs, send
Emails client.emails.send(), sendRaw, get, list, update, cancel
Batch client.batch.send([…])
Compose client.compose.send(…) (deprecated — use emails)
Mail logs client.mailLogs.list(page: 1, pageSize: 20, status: 'sent')

Request/response JSON matches /api/v1.

Docs #

Releasing #

  1. Bump version in pubspec.yaml (and CHANGELOG.md) in the monorepo PR.
  2. Merge to main/master → GitHub Action syncs this folder to teamredevs/mailofly-dart.
  3. Publish workflow runs and publishes to pub.flutter-io.cn only when the version is new.

License #

MIT

1
likes
140
points
142
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Official Dart client for the Mailofly REST API (one-off compose, contacts, templates, campaigns, and more).

Homepage
Repository (GitHub)
View/report issues

Topics

#email #api-client #http

License

MIT (license)

Dependencies

http

More

Packages that depend on mailofly