fix(mail): refactor(mail): Remove Mailgun references from PlatformService. Update keywords, error messages, and documentation to use MTA exclusively.

This commit is contained in:
Philipp Kunz 2025-05-08 01:37:38 +00:00
parent 0e914a3366
commit d3d197d9d3
9 changed files with 36 additions and 15 deletions

View File

@ -1,5 +1,22 @@
# Changelog
## 2025-05-08 - 2.8.4 - fix(mail)
refactor(mail): Remove Mailgun references from PlatformService. Update keywords, error messages, and documentation to use MTA exclusively.
- Removed Mailgun integration from keywords in package.json and npmextra.json
- Updated EmailService to remove Mailgun API key usage and reference MTA instead
- Updated changelog.md and readme.md to reflect removal of Mailgun and update examples
- Revised error messages to mention 'MTA not configured' instead of generic provider errors
- Updated readme.plan.md to document Mailgun removal
## 2025-05-08 - 2.8.3 - refactor(mail): Remove Mailgun references
Remove all Mailgun references from the codebase since it's no longer used as an email provider
- Removed "mailgun integration" from keywords in package.json and npmextra.json
- Updated comments and documentation in EmailService to remove Mailgun mentions
- Updated error messages to reference MTA instead of generic email providers
- Updated the readme email example to use PlatformService reference instead of Mailgun API key
## 2025-05-08 - 2.8.2 - fix(tests)
Fix outdated import paths in test files for dcrouter and ratelimiter modules

View File

@ -18,7 +18,6 @@
"mail parsing",
"DKIM",
"platform service",
"mailgun integration",
"letterXpress",
"OpenAI",
"Anthropic AI",

View File

@ -1,7 +1,7 @@
{
"name": "@serve.zone/platformservice",
"private": true,
"version": "2.8.2",
"version": "2.8.3",
"description": "A multifaceted platform service handling mail, SMS, letter delivery, and AI services.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
@ -61,7 +61,6 @@
"mail parsing",
"DKIM",
"platform service",
"mailgun integration",
"letterXpress",
"OpenAI",
"Anthropic AI",

View File

@ -51,7 +51,7 @@ async function sendEmail() {
body: '<h1>This is a test email</h1>',
};
const emailService = new EmailService('MAILGUN_API_KEY'); // Replace with your real API key
const emailService = new EmailService(platformService);
await emailService.sendEmail(emailOptions);
console.log('Email sent successfully.');
@ -326,7 +326,3 @@ async function useAiService() {
useAiService();
```
### Conclusion
The `@serve.zone/platformservice` offers a robust set of features for modern application requirements, including but not limited to communication and AI services. By following the examples above, developers can integrate these services into their applications, harnessing the power of email, SMS, letters, MTA capabilities, and artificial intelligence seamlessly.

View File

@ -1,3 +1,13 @@
# PlatformService Roadmap
## Latest Changes
### Mailgun Removal
- [x] Remove Mailgun integration from keywords in package.json and npmextra.json
- [x] Update EmailService comments to remove mentions of Mailgun
- [x] Update error messages to reference MTA instead of generic email providers
- [x] Update the readme email example to use PlatformService reference instead of Mailgun API key
# DcRouter Consolidated Email Configuration Plan
## Overview

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/platformservice',
version: '2.8.2',
version: '2.8.4',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
}

View File

@ -69,10 +69,10 @@ export class ApiManager {
return status;
}
// For Mailgun, we don't have a status check implementation currently
// Status tracking not available if MTA is not configured
return {
status: 'unknown',
details: { message: 'Status tracking not available for current provider' }
details: { message: 'Status tracking not available without MTA configuration' }
};
})
);

View File

@ -25,7 +25,7 @@ export interface IEmailConstructorOptions {
}
/**
* Email service with support for both Mailgun and local MTA
* Email service with MTA support
*/
export class EmailService {
public platformServiceRef: SzPlatformService;
@ -128,7 +128,7 @@ export class EmailService {
}
/**
* Send an email using the configured provider (Mailgun or MTA)
* Send an email using the MTA
* @param email The email to send
* @param to Recipient(s)
* @param options Additional options
@ -142,7 +142,7 @@ export class EmailService {
if (this.config.useMta && this.mtaConnector) {
return this.mtaConnector.sendEmail(email, to, options);
} else {
throw new Error('No email provider configured');
throw new Error('MTA not configured');
}
}

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/platformservice',
version: '2.8.2',
version: '2.8.4',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
}