mandrill 2.0.0 copy "mandrill: ^2.0.0" to clipboard
mandrill: ^2.0.0 copied to clipboard

An unofficial but maintained API client for the Mandrill email as a service product.

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 = Logger('Mandrill Example');

  final mandrill = createMandrill(apiKey);

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

  final message = 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());
  }
}
1
likes
120
pub points
47%
popularity

Publisher

unverified uploader

An unofficial but maintained API client for the Mandrill email as a service product.

Repository (GitLab)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

conduit_codable, http, intl, logging, meta

More

Packages that depend on mandrill