@@ -110,6 +110,12 @@ export const DISABLE_SIGNUPS = process.env.DISABLE_SIGNUPS === 'true';
|
||||
// Controls whether email validation checks are performed on signup (default: false)
|
||||
export const VERIFY_EMAIL_ON_SIGNUP = process.env.VERIFY_EMAIL_ON_SIGNUP === 'true';
|
||||
|
||||
// Attachment Limits (optional)
|
||||
// Maximum total attachment size in MB (default: 10). AWS SES supports up to 40 MB.
|
||||
export const MAX_ATTACHMENT_SIZE_MB = Number(validateEnv('MAX_ATTACHMENT_SIZE_MB', '10'));
|
||||
// Maximum number of attachments per email (default: 10)
|
||||
export const MAX_ATTACHMENTS_COUNT = Number(validateEnv('MAX_ATTACHMENTS_COUNT', '10'));
|
||||
|
||||
// Email Verification & Password Reset
|
||||
export const TOKEN_EXPIRY_SECONDS = 3600; // 1 hour
|
||||
export const EMAIL_VERIFICATION_RATE_LIMIT = 3; // Max 3 emails per hour
|
||||
|
||||
@@ -120,7 +120,7 @@ export class Actions {
|
||||
* - data: object (optional) - Contact data and template variables
|
||||
* - Simple values are saved to contact (persistent)
|
||||
* - {value: any, persistent: false} are only used for this email (non-persistent)
|
||||
* - attachments: array (optional) - Email attachments (max 10, 10MB total)
|
||||
* - attachments: array (optional) - Email attachments (configurable via MAX_ATTACHMENTS_COUNT / MAX_ATTACHMENT_SIZE_MB, defaults: 10 / 10MB)
|
||||
* - filename: string (required) - Attachment filename
|
||||
* - content: string (required) - Base64 encoded file content
|
||||
* - contentType: string (required) - MIME type (e.g., "application/pdf")
|
||||
|
||||
@@ -787,8 +787,8 @@ describe('EmailService', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should validate attachment size limit (10MB total)', () => {
|
||||
// Exceeds ~13.3M base64 chars limit
|
||||
it('should validate attachment size limit (10MB total default)', () => {
|
||||
// Exceeds ~13.4M base64 chars for the default 10MB limit
|
||||
const largeContent = 'A'.repeat(14000000);
|
||||
|
||||
const result = ActionSchemas.send.safeParse({
|
||||
|
||||
Reference in New Issue
Block a user