mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
feat(Send Email Node): Add content-id for email attachments (#3632)
This commit is contained in:
parent
e88b9d880a
commit
8fe8aad6a7
|
@ -3,7 +3,9 @@ import type {
|
|||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { createTransport } from 'nodemailer';
|
||||
import type SMTPTransport from 'nodemailer/lib/smtp-transport';
|
||||
|
@ -100,7 +102,7 @@ const properties: INodeProperties[] = [
|
|||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'Name of the binary properties that contain data to add to email as attachment. Multiple ones can be comma-separated.',
|
||||
'Name of the binary properties that contain data to add to email as attachment. Multiple ones can be comma-separated. Reference embedded images or other content within the body of an email message, e.g. <img src="cid:image_1">',
|
||||
},
|
||||
{
|
||||
displayName: 'CC Email',
|
||||
|
@ -227,6 +229,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
attachments.push({
|
||||
filename: binaryData.fileName || 'unknown',
|
||||
content: await this.helpers.getBinaryDataBuffer(itemIndex, propertyName),
|
||||
cid: propertyName,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -255,7 +258,8 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
});
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
delete error.cert;
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue