aws-lambda-ses-forwarder
aws-lambda-ses-forwarder copied to clipboard
Adding a custom header
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"});
Try to use \n line delimiter in end of header instead of \r.