fix: remove problematic mailgun.js/Types import
- Remove unused MailgunMessageData type import - Remove type annotations for messageData - Resolves TypeScript compilation error in email-worker The mailgun.js package doesn't properly expose Types module, and the type annotation wasn't necessary since mailgunClient is already typed as any. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import formData from 'form-data';
|
import formData from 'form-data';
|
||||||
import Mailgun from 'mailgun.js';
|
import Mailgun from 'mailgun.js';
|
||||||
import { createLogger } from './logger';
|
import { createLogger } from './logger';
|
||||||
import { MailgunMessageData } from 'mailgun.js/Types';
|
|
||||||
|
|
||||||
const log = createLogger("email:mailgun");
|
const log = createLogger("email:mailgun");
|
||||||
|
|
||||||
@@ -47,14 +46,13 @@ export async function sendEmail(message: EmailMessage): Promise<boolean> {
|
|||||||
const client = getMailgunClient();
|
const client = getMailgunClient();
|
||||||
const domain = process.env.MAILGUN_DOMAIN || 'rezije.app';
|
const domain = process.env.MAILGUN_DOMAIN || 'rezije.app';
|
||||||
|
|
||||||
const messageData:MailgunMessageData = {
|
const messageData = {
|
||||||
from: 'rezije.app <noreply@rezije.app>',
|
from: 'rezije.app <noreply@rezije.app>',
|
||||||
to: message.to,
|
to: message.to,
|
||||||
subject: message.subject,
|
subject: message.subject,
|
||||||
html: message.html,
|
html: message.html,
|
||||||
"v:locationID": "12345" // testing custom variable - webhook should pick this up
|
"v:locationID": "12345" // testing custom variable - webhook should pick this up
|
||||||
} as MailgunMessageData;
|
};
|
||||||
|
|
||||||
|
|
||||||
log(`Sending email to ${message.to}: ${message.subject}`);
|
log(`Sending email to ${message.to}: ${message.subject}`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user