-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
|
||
if (!email) { | ||
return { | ||
|
@@ -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 commentThe 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 |
||
for (const [key, value] of params) { | ||
comment = comment.concat(`${key}: ${value}\n\n`); | ||
} | ||
|
@@ -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 commentThe 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 |
||
comment: { | ||
body: comment, | ||
} | ||
|
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