mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44:06 -08:00
feat: add in-reply-to and references to reply emails
This commit is contained in:
parent
f64a41d617
commit
817edea705
|
@ -181,6 +181,22 @@ const properties: INodeProperties[] = [
|
||||||
placeholder: 'info@example.com',
|
placeholder: 'info@example.com',
|
||||||
description: 'The email address to send the reply to',
|
description: 'The email address to send the reply to',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'In Reply To',
|
||||||
|
name: 'inReplyTo',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
placeholder: '<msg-id-123@email.example.com>',
|
||||||
|
description: 'Message ID to reply to',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'References',
|
||||||
|
name: 'references',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
placeholder: '<msg-id-123@email.example.com>,<msg-id-456@email.example.com>',
|
||||||
|
description: 'List of message IDs to reference, separated by commas',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -201,6 +217,8 @@ type EmailSendOptions = {
|
||||||
ccEmail?: string;
|
ccEmail?: string;
|
||||||
bccEmail?: string;
|
bccEmail?: string;
|
||||||
replyTo?: string;
|
replyTo?: string;
|
||||||
|
inReplyTo?: string;
|
||||||
|
references?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function configureTransport(credentials: IDataObject, options: EmailSendOptions) {
|
function configureTransport(credentials: IDataObject, options: EmailSendOptions) {
|
||||||
|
@ -259,6 +277,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
||||||
bcc: options.bccEmail,
|
bcc: options.bccEmail,
|
||||||
subject,
|
subject,
|
||||||
replyTo: options.replyTo,
|
replyTo: options.replyTo,
|
||||||
|
inReplyTo: options.inReplyTo,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (emailFormat === 'text' || emailFormat === 'both') {
|
if (emailFormat === 'text' || emailFormat === 'both') {
|
||||||
|
@ -314,7 +333,11 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
||||||
mailOptions.attachments = attachments;
|
mailOptions.attachments = attachments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (options.inReplyTo && (!options.references || options.references.trim() === '')) {
|
||||||
|
mailOptions.references = mailOptions.inReplyTo;
|
||||||
|
} else if (options.references && options.references.trim() !== '') {
|
||||||
|
mailOptions.references = options.references.split(',').map(ref => ref.trim()).join(' ');
|
||||||
|
}
|
||||||
const info = await transporter.sendMail(mailOptions);
|
const info = await transporter.sendMail(mailOptions);
|
||||||
|
|
||||||
returnData.push({
|
returnData.push({
|
||||||
|
|
Loading…
Reference in a new issue