https://github.com/dylanroman03/easy_resend
A Dart package for easy integration with the Easy Resend API to send emails with attachments.
https://github.com/dylanroman03/easy_resend
api dart dart-package resend resend-email resendapi
Last synced: 7 months ago
JSON representation
A Dart package for easy integration with the Easy Resend API to send emails with attachments.
- Host: GitHub
- URL: https://github.com/dylanroman03/easy_resend
- Owner: dylanroman03
- License: mit
- Created: 2024-03-04T18:29:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-21T17:38:03.000Z (over 1 year ago)
- Last Synced: 2025-10-23T02:53:39.103Z (7 months ago)
- Topics: api, dart, dart-package, resend, resend-email, resendapi
- Language: Dart
- Homepage: https://pub.dev/packages/easy_resend
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Easy Resend
A Dart package for easy integration with the Easy Resend API to send emails with attachments.
## Installation
Add the following dependency to your `pubspec.yaml`:
```yaml
dependencies:
easy_resend: ^1.0.2
```
## Usage
```dart
import 'package:easy_resend/easy_resend.dart';
import 'package:easy_resend/src/models/attachment.dart';
void main() async {
// Initialize EasyResend with your API key
EasyResend.initialize('your_api_key_here');
// Create an instance of EasyResend
final easyResend = EasyResend.getInstance();
// Prepare email data
final from = 'sender@example.com';
final to = ['recipient1@example.com', 'recipient2@example.com'];
final subject = 'Test Email';
final text = 'This is a test email sent using Easy Resend.';
final attachments = [
Attachment(filename: 'invoice.pdf', content: Uint8List.fromList([])),
Attachment(filename: 'image.jpg', content: Uint8List.fromList([])),
];
try {
// Send the email
final id = await easyResend.sendEmail(
from: from,
to: to,
subject: subject,
text: text,
attachments: attachments,
);
print('Email sent successfully! ID: $id');
} catch (e) {
print('Failed to send email: $e');
}
}
```
Replace `'your_api_key_here'` with your actual API key. You can also customize the email data according to your requirements.
## Features
- Send emails with attachments using the Easy Resend API.
- Handle error responses gracefully.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.