feat(structure): Use unified Email class
This commit is contained in:
@ -1160,17 +1160,8 @@ export class UnifiedEmailServer extends EventEmitter {
|
||||
logger.log('info', 'Processing potential bounce notification email');
|
||||
|
||||
try {
|
||||
// Convert Email to Smartmail format for bounce processing
|
||||
const smartmailEmail = new plugins.smartmail.Smartmail({
|
||||
from: bounceEmail.from,
|
||||
to: [bounceEmail.to[0]], // Ensure to is an array with at least one recipient
|
||||
subject: bounceEmail.subject,
|
||||
body: bounceEmail.text, // Smartmail uses 'body' instead of 'text'
|
||||
htmlBody: bounceEmail.html // Smartmail uses 'htmlBody' instead of 'html'
|
||||
});
|
||||
|
||||
// Process as a bounce notification
|
||||
const bounceRecord = await this.bounceManager.processBounceEmail(smartmailEmail);
|
||||
// Process as a bounce notification (no conversion needed anymore)
|
||||
const bounceRecord = await this.bounceManager.processBounceEmail(bounceEmail);
|
||||
|
||||
if (bounceRecord) {
|
||||
logger.log('info', `Successfully processed bounce notification for ${bounceRecord.recipient}`, {
|
||||
|
Reference in New Issue
Block a user