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

outdated

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 = 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());
  }
}
1
likes
0
pub points
51%
popularity

Publisher

unverified uploader

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

Repository (GitLab)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

codable, http, intl, logging, meta

More

Packages that depend on mandrill