Selectors with description
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import type {Prisma} from '@plunk/db';
|
||||
import {EmailSourceType, EmailStatus} from '@plunk/db';
|
||||
import {EmailSourceType, EmailStatus, TrackingMode} from '@plunk/db';
|
||||
import {createServiceMocks, factories, getPrismaClient} from '../../../../../test/helpers';
|
||||
|
||||
// Mock MeterService
|
||||
@@ -16,7 +16,7 @@ describe('Email Processor', () => {
|
||||
const _serviceMocks = createServiceMocks();
|
||||
|
||||
beforeEach(async () => {
|
||||
const {project} = await factories.createUserWithProject({}, {trackingEnabled: true});
|
||||
const {project} = await factories.createUserWithProject({}, {tracking: TrackingMode.ENABLED});
|
||||
projectId = project.id;
|
||||
});
|
||||
|
||||
|
||||
@@ -89,6 +89,9 @@ export function createEmailWorker() {
|
||||
? {name: email.toName, email: email.contact.email}
|
||||
: email.contact.email;
|
||||
|
||||
// Determine tracking based on project settings and email type
|
||||
const shouldTrack = EmailService.shouldTrackEmail(email.project.tracking, email.sourceType);
|
||||
|
||||
// Send via AWS SES
|
||||
const result = await sendRawEmail({
|
||||
from: {
|
||||
@@ -101,7 +104,7 @@ export function createEmailWorker() {
|
||||
html: compiledHtml,
|
||||
},
|
||||
reply: email.replyTo || undefined,
|
||||
tracking: email.project.trackingEnabled, // Use project's tracking preference
|
||||
tracking: shouldTrack,
|
||||
attachments: email.attachments as {filename: string; content: string; contentType: string}[] | null,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user