-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
@@ -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; |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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}`, |
There was a problem hiding this comment.
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
goes with PRX/dovetail-marketing-site#34