From e681760fba6c887be3184f8af7d70f223f275eb0 Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Sat, 30 Nov 2024 11:26:19 +0100 Subject: [PATCH] fix: README.md --- CHANGELOG.md | 6 ++++++ README.md | 43 ++++++++++++++++++++++++++++++++++++-- bin/impaktfull_mailer.dart | 1 + 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b78d64c..9059b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +## Docs + +- Added propper docs in README.md + ## 0.0.1 - Initial version. diff --git a/README.md b/README.md index 3816eca..0b88f79 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ -A sample command-line application with an entrypoint in `bin/`, library code -in `lib/`, and example unit test in `test/`. +# impaktfull_mailer + +A dart library for sending emails on backend with a template engine. + +## Disclaimer + +**impaktfull_mailer is still in unstable & untested. everything under <1.0.0 should not be used unless you want to test it** + +## Setup + +### Add dependency to pubspec + +[![pub package](https://img.shields.io/pub/v/impaktfull_mailer.svg)](https://pub.dartlang.org/packages/impaktfull_mailer) + +``` +dependencies: + impaktfull_mailer: `latest_version` +``` + +### Send an email + +```dart +/// Create the mailer +final mailer = ImpaktfullMailer( + mailSenderService: BrevoMailSenderService( + email: 'your_brevo_smtp_email', + password: 'your_brevo_smtp_password', + ), // or any other mail sender service + variableReplacer: BracketVariableReplacer(), // default + defaultLocale: 'en',// default +); +/// Create the template +final template = YourTemplate(); +/// Send the email +await mailer.sendEmailTemplate( + fromEmail: 'hello@impaktfull.com', + to: ['koen.vanlooveren@impaktfull.com'], + subject: 'Test from the impaktfull_mailer dart package', + template: template, +); +``` diff --git a/bin/impaktfull_mailer.dart b/bin/impaktfull_mailer.dart index cda1e98..241c16e 100644 --- a/bin/impaktfull_mailer.dart +++ b/bin/impaktfull_mailer.dart @@ -10,6 +10,7 @@ Future main(List arguments) async { email: ImpaktfullMailerSecrets.brevoEmail, password: ImpaktfullMailerSecrets.brevoPassword, ), + variableReplacer: BracketVariableReplacer(), ); // Step 2: Create an html template final template = OrderConfirmationMailTemplate(