Skip to content

Commit

Permalink
Merge pull request #791 from PRX/feat/dt-marketing-site-optout
Browse files Browse the repository at this point in the history
Update the form for ip optout
  • Loading branch information
kookster authored Nov 19, 2024
2 parents b2a04c3 + c38a2b6 commit f08889b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spire/templates/apps/dovetail-marketing-form-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ Resources:
const email = params.get('inputEmail');
const name = params.get('inputName') || 'Unknown';
const organization = params.get('textOrganization') || 'Unknown';
const type = params.get('messageType') || 'Unknown';
const sourceIp = event.requestContext.http.sourceIp;
const userAgent = event.requestContext.http.userAgent;
if (!email) {
return {
Expand All @@ -117,7 +120,7 @@ Resources:
// Concat all form fields from the request as the ticket
// comment body
let comment = '';
let comment = `sourceIp: ${sourceIp}\n\nuserAgent: ${userAgent}\n\n-----\n\n`;
for (const [key, value] of params) {
comment = comment.concat(`${key}: ${value}\n\n`);
}
Expand All @@ -129,7 +132,7 @@ Resources:
email,
name,
},
subject: `Website form submission: ${organization}`,
subject: `Website form submission: ${type} - ${organization}`,
comment: {
body: comment,
}
Expand Down

0 comments on commit f08889b

Please sign in to comment.