Skip to content

Commit

Permalink
Update the form for ip optout
Browse files Browse the repository at this point in the history
  • Loading branch information
kookster committed Nov 16, 2024
1 parent 6ccc753 commit c38a2b6
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 c38a2b6

Please sign in to comment.