mandrill 1.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 69

Mandrill API

This is a native dart implementation of a Mandrill API client.

It's not a fork of the other mandrill_api package, because the other library is quite old, unmaintained and not very suitable to be ported to Dart 2.0

Usage

import 'package:mandrill/mandrill_server.dart';
// or if you're in the browser:
// import 'package:mandrill/mandrill_browser.dart';

final apiKey = 'your-key';

main() async {
  final mandrill = createMandrill(apiKey);

  final recipients = [
    new Recipient(email: 'customer1@example.com', name: 'Customer 1'),
    new Recipient(email: 'customer2@example.com', name: 'Customer 2', type: RecipientType.bcc),
  ];

  final message = new OutgoingMessage(
    html: '<h1>Welcome to our website</h1>',
    text: 'WELCOME TO OUR WEBSITE',
    to: recipients,
    /* etc... */
  );

  final response = await mandrill.messages.send(message);
}

For a full example, please see example/example.dart.

Stability

This library is meant to be rock solid, using Codable to (de)serialize JSON messages, well tested and used in production.

Completeness

We have only implemented a subset of the full API calls, because we don't need the other calls right now.

To see which API calls have been implemented, please check the API Documentation.

If you need other resources to be implemented we are happy to accept Merge Requests, but we are also willing to add new resources if requested.

License

MIT

Changelog

1.1.1

  • Make Recipient.name optional.

1.1.0

  • Expose package:mandrill/mandrill.dart in package:mandrill/mandrill_server.dart so users of this library don't need to import both files.

1.0.1

  • Add analysis_options.yaml and fix all errors, warnings and hints.

1.0.0

  • Initial release of the library

example/example.dart

import 'package:logging/logging.dart';
import 'package:mandrill/mandrill_server.dart';

const apiKey = 'your-key';

void main() async {
  Logger.root
    ..level = Level.ALL
    ..onRecord.listen(print);

  final log = new Logger('Mandrill Example');

  final mandrill = createMandrill(apiKey);

  final recipients = [
    new Recipient(email: 'customer1@example.com', name: 'Customer 1'),
    new Recipient(
        email: 'customer2@example.com',
        name: 'Customer 2',
        type: RecipientType.bcc),
  ];

  final message = new OutgoingMessage(
    html: '<h1>Welcome to our website</h1>',
    text: 'WELCOME TO OUR WEBSITE',
    fromEmail: 'good@website.com',
    fromName: 'Greatest Website',
    to: recipients,
    important: true,
  );

  try {
    final response = await mandrill.messages.send(message);
    log.info('${response.sentMessages.length} messages have been sent.');
  } on MandrillException catch (e) {
    log.severe(e.toString());
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  mandrill: ^1.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mandrill/mandrill.dart';
  
Version Uploaded Documentation Archive
1.1.1 Aug 9, 2018 Go to the documentation of mandrill 1.1.1 Download mandrill 1.1.1 archive
1.1.0 Aug 9, 2018 Go to the documentation of mandrill 1.1.0 Download mandrill 1.1.0 archive
1.0.1 Aug 7, 2018 Go to the documentation of mandrill 1.0.1 Download mandrill 1.0.1 archive
1.0.0 Aug 6, 2018 Go to the documentation of mandrill 1.0.0 Download mandrill 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:mandrill/mandrill.dart.

Health issues and suggestions

Document public APIs (-9.14 points)

159 out of 174 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <3.0.0
codable ^1.0.0 1.0.0
http ^0.11.0 0.11.3+17 0.12.0
intl ^0.15.0 0.15.7
logging ^0.11.0 0.11.3+2
meta ^1.1.6 1.1.6
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
grind_publish ^0.0.3
grinder ^0.8.3
mockito ^3.0.0
test ^1.3.0