fix: resolve worker attachment sending failure
This commit is contained in:
@@ -7,6 +7,7 @@ import settingService from './setting-service';
|
|||||||
import accountService from './account-service';
|
import accountService from './account-service';
|
||||||
import BizError from '../error/biz-error';
|
import BizError from '../error/biz-error';
|
||||||
import emailUtils from '../utils/email-utils';
|
import emailUtils from '../utils/email-utils';
|
||||||
|
import fileUtils from '../utils/file-utils';
|
||||||
import { Resend } from 'resend';
|
import { Resend } from 'resend';
|
||||||
import attService from './att-service';
|
import attService from './att-service';
|
||||||
import { parseHTML } from 'linkedom';
|
import { parseHTML } from 'linkedom';
|
||||||
@@ -401,6 +402,8 @@ const emailService = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(sendForm)
|
||||||
|
|
||||||
const result = await c.env.EMAIL.send(sendForm);
|
const result = await c.env.EMAIL.send(sendForm);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -455,6 +458,10 @@ const emailService = {
|
|||||||
content = content.split(',')[1] || content;
|
content = content.split(',')[1] || content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof content === 'string') {
|
||||||
|
content = fileUtils.base64ToUint8Array(content.replace(/\s+/g, '')).buffer;
|
||||||
|
}
|
||||||
|
|
||||||
const item = {
|
const item = {
|
||||||
content,
|
content,
|
||||||
filename: attachment.filename,
|
filename: attachment.filename,
|
||||||
|
|||||||
Reference in New Issue
Block a user