feat: append IP + geo (city, region, country, org) to feedback webhook via ipapi.co
This commit is contained in:
+12
@@ -2653,6 +2653,18 @@
|
||||
var fd = new FormData();
|
||||
fd.append("message", text);
|
||||
fd.append("page", window.location.href);
|
||||
try {
|
||||
var geo = await fetch(
|
||||
"https://ipapi.co/json/",
|
||||
).then(function (r) {
|
||||
return r.json();
|
||||
});
|
||||
fd.append("ip", geo.ip || "");
|
||||
fd.append("city", geo.city || "");
|
||||
fd.append("region", geo.region || "");
|
||||
fd.append("country", geo.country_name || "");
|
||||
fd.append("org", geo.org || "");
|
||||
} catch (_) {}
|
||||
await fetch(
|
||||
"https://002-001-5dd6e535-4d1c-46bc-9bd9-42ad4bc5f082.odoo4projects.com/webhook/2fe3d1fe-eff9-45aa-8d0f-88738d443946",
|
||||
{ method: "POST", body: fd },
|
||||
|
||||
Reference in New Issue
Block a user