Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
mailofly
dependencies: mailofly: ^0.2.0
dart pub add mailofly # or flutter pub add mailofly
import 'package:mailofly/mailofly.dart'; final client = Mailofly( apiKey: 'mf_live_…', ); // Always close when done (releases the HTTP client) await client.close();
try { final result = await client.emails.send( from: 'Acme <onboarding@example.com>', to: ['alex@example.com'], subject: 'Hello', html: '<p>Thanks for signing up.</p>', tags: [{'name': 'category', 'value': 'welcome'}], ); print('Sent: ${result['id']}'); } on MailoflyException catch (e) { print('${e.statusCode} ${e.error} ${e.message}'); } finally { client.close(); }
await client.emails.send( from: 'Acme <onboarding@example.com>', to: ['alex@example.com'], template: { 'id': 'uuid-of-template', 'variables': {'first_name': 'Alex'}, }, );
client.compose.send
/v1/emails
final result = await client.batch.send([ { 'from': 'Acme <onboarding@example.com>', 'to': ['foo@example.com'], 'subject': 'hello world', 'html': '<h1>it works!</h1>', }, { 'from': 'Acme <onboarding@example.com>', 'to': ['bar@example.com'], 'subject': 'world hello', 'html': '<p>it works!</p>', }, ]);
client.identities.list()
get
update
delete
client.identities
client.contacts.list(segmentId: …)
create
client.templates.list()
client.segments.list()
client.segments.contacts(id).list/add/remove
client.campaigns.list()
runs
send
client.emails.list()
sendRaw
cancel
client.batch.send([…])
client.compose.send(…)
client.mailLogs.list(page: 1, pageSize: 20, status: 'sent')
// List sending identities final identities = await client.identities.list(); print(identities['data']); // Create a contact await client.contacts.create({ 'email': 'alex@example.com', 'first_name': 'Alex', });
final meta = await Mailofly.discovery(); print(meta['resources']);