From d3d197d9d3d1751183e3dd6a7051e495cbe3a125 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 8 May 2025 01:37:38 +0000 Subject: [PATCH] fix(mail): refactor(mail): Remove Mailgun references from PlatformService. Update keywords, error messages, and documentation to use MTA exclusively. --- changelog.md | 17 +++++++++++++++++ npmextra.json | 1 - package.json | 3 +-- readme.md | 6 +----- readme.plan.md | 10 ++++++++++ ts/00_commitinfo_data.ts | 2 +- ts/mail/services/classes.apimanager.ts | 4 ++-- ts/mail/services/classes.emailservice.ts | 6 +++--- ts_web/00_commitinfo_data.ts | 2 +- 9 files changed, 36 insertions(+), 15 deletions(-) diff --git a/changelog.md b/changelog.md index 3d5d0ee..1e6ad57 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/npmextra.json b/npmextra.json index 2bf4acb..f17a201 100644 --- a/npmextra.json +++ b/npmextra.json @@ -18,7 +18,6 @@ "mail parsing", "DKIM", "platform service", - "mailgun integration", "letterXpress", "OpenAI", "Anthropic AI", diff --git a/package.json b/package.json index e019b46..9b35631 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/readme.md b/readme.md index 6a053bf..81398a6 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,7 @@ async function sendEmail() { body: '

This is a test email

', }; - 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. \ No newline at end of file diff --git a/readme.plan.md b/readme.plan.md index a33c44a..73c5148 100644 --- a/readme.plan.md +++ b/readme.plan.md @@ -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 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index eb94081..11005f9 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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.' } diff --git a/ts/mail/services/classes.apimanager.ts b/ts/mail/services/classes.apimanager.ts index 9fe1231..59ad892 100644 --- a/ts/mail/services/classes.apimanager.ts +++ b/ts/mail/services/classes.apimanager.ts @@ -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' } }; }) ); diff --git a/ts/mail/services/classes.emailservice.ts b/ts/mail/services/classes.emailservice.ts index 1c91ad0..0c2b17e 100644 --- a/ts/mail/services/classes.emailservice.ts +++ b/ts/mail/services/classes.emailservice.ts @@ -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'); } } diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index eb94081..11005f9 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -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.' }