Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the form for ip optout #791

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

kookster
Copy link
Member

@@ -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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get the IP from the form, but I want to have and use the IP from the actual request, and the user agent as well, for reviewing the request.

@@ -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';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this for both the contact and optout requests, so I introduced a type to specify that, mostly for including in the ZD ticket subject to know how to handle the request more easily

@@ -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`;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these at the top of the list of data in the ZD ticket body

@@ -129,7 +132,7 @@ Resources:
email,
name,
},
subject: `Website form submission: ${organization}`,
subject: `Website form submission: ${type} - ${organization}`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the type in here as well, so you can see immediately if this is a contact or optout message

@kookster kookster merged commit f08889b into main Nov 19, 2024
4 checks passed
@kookster kookster deleted the feat/dt-marketing-site-optout branch November 19, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants