aws-lambda-ses-forwarder icon indicating copy to clipboard operation
aws-lambda-ses-forwarder copied to clipboard

Adding a custom header

Open nickj69 opened this issue 8 years ago • 1 comments

I've got this working successfully but wanted to track my bounces and errors via CloudWatch.

In order to do this it seems like I need to add a custom header (X-SES-CONFIGURATION-SET) to my forwarded emails. http://docs.aws.amazon.com/ses/latest/DeveloperGuide/event-publishing-send-email.html

I've tried doing this but I'm some how mutilating the header and it's throwing this error: message: 'sendRawEmail() returned error.', error: { [InvalidParameterValue: Duplicate header 'Content-Type'.] message: 'Duplicate header \'Content-Type\'.', code: 'InvalidParameterValue',

I inserted the following code into the process.message function, at the very end: header = header + 'X-SES-CONFIGURATION-SET: cloudwatch_SES_destination\r'; data.log({level: "info", message: "Added Configuration Group Tag"});

nickj69 avatar May 02 '17 07:05 nickj69

Try to use \n line delimiter in end of header instead of \r.

jakubboucek avatar Jun 17 '17 16:06 jakubboucek