You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defines the abstract interface for email clients used within the Headlines Toolkit backend system. This package provides the contract (`HtEmailClient`) that concrete implementations (e.g., SMTP, AWS SES, SendGrid clients) should adhere to.
7
+
This package provides the contract (`EmailClient`) that concrete implementations (e.g., SMTP, AWS SES, SendGrid clients) should adhere to.
8
8
9
9
## Getting Started
10
10
11
11
To use this package in your Dart backend project (like Dart Frog), add it to your `pubspec.yaml` file:
# Use a specific ref/tag for stability in production
19
19
# ref: main
20
20
```
@@ -23,29 +23,29 @@ Then run `dart pub get`.
23
23
24
24
## Features
25
25
26
-
***`HtEmailClient` Abstract Class:** Defines a generic, provider-agnostic interface for sending transactional emails. This approach decouples application logic from email content and styling, which can be managed directly within your email service provider (e.g., SendGrid, AWS SES).
27
-
*`Future<void> sendTransactionalEmail({required String senderEmail, required String recipientEmail, required String templateId, required Map<String, dynamic> templateData})`: Sends an email using a pre-defined template. Implementations must handle underlying service errors and map them to standard `ht_shared` exceptions.
26
+
***`EmailClient` Abstract Class:** Defines a generic, provider-agnostic interface for sending transactional emails. This approach decouples application logic from email content and styling, which can be managed directly within your email service provider (e.g., SendGrid, AWS SES).
27
+
*`Future<void> sendTransactionalEmail({required String senderEmail, required String recipientEmail, required String templateId, required Map<String, dynamic> templateData})`: Sends an email using a pre-defined template. Implementations must handle underlying service errors and map them to standard `core` exceptions.
28
28
29
29
## Usage
30
30
31
-
This package only provides the abstract interface. You need a concrete implementation package (e.g., `ht_email_sendgrid`) that implements `HtEmailClient`.
31
+
This package only provides the abstract interface. You need a concrete implementation package (e.g., `ht_email_sendgrid`) that implements `EmailClient`.
32
32
33
33
In your backend application (e.g., Dart Frog), you would typically:
34
34
35
35
1. Depend on a concrete implementation package.
36
36
2. Configure and provide an instance of the concrete client using dependency injection.
37
-
3. Inject `HtEmailClient` into your services where email sending is required.
37
+
3. Inject `EmailClient` into your services where email sending is required.
38
38
39
39
```dart
40
40
// Example (Conceptual - in a service or route handler)
This package is licensed under the [PolyForm Free Trial](LICENSE). Please review the terms before use.
73
+
## 🔑 Licensing
74
+
75
+
This package is source-available and licensed under the [PolyForm Free Trial 1.0.0](LICENSE). Please review the terms before use.
76
+
77
+
For commercial licensing options that grant the right to build and distribute unlimited applications, please visit the main [**Flutter News App - Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code) organization.
0 commit comments