Skip to content

Commit

Permalink
Use n8n instead of zapier to save text feedback to google sheets (#542)
Browse files Browse the repository at this point in the history
* Use n8n instead of zapier to save text feedback to google sheets

* Add n8n webhook endpoint to deploy script
  • Loading branch information
louis-md authored Jul 29, 2024
1 parent e4cfe1f commit 27e101d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ NEXT_PUBLIC_HOST_URL='http://localhost:3000'
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=
NEXT_PUBLIC_GOOGLE_ANALYTICS_DOMAIN=
NEXT_PUBLIC_IS_PRODUCTION=false
NEXT_PUBLIC_ZAPIER_WEBHOOK_URL=
NEXT_PUBLIC_N8N_WEBHOOK_URL=
GITHUB_TOKEN=
2 changes: 1 addition & 1 deletion .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
NEXT_PUBLIC_GOOGLE_ANALYTICS_DOMAIN: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS_DOMAIN }}
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID }}
NEXT_PUBLIC_IS_PRODUCTION: true
NEXT_PUBLIC_ZAPIER_WEBHOOK_URL: ${{ secrets.NEXT_PUBLIC_ZAPIER_WEBHOOK_URL }}
NEXT_PUBLIC_N8N_WEBHOOK_URL: ${{ secrets.NEXT_PUBLIC_N8N_WEBHOOK_URL }}
NEXT_PUBLIC_HOST_URL: 'https://docs.safe.global'

- name: Configure AWS credentials
Expand Down
4 changes: 2 additions & 2 deletions components/Feedback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ const Feedback: React.FC<{
: {})
})
if (
process.env.NEXT_PUBLIC_ZAPIER_WEBHOOK_URL != null
process.env.NEXT_PUBLIC_N8N_WEBHOOK_URL != null
&& process.env.NEXT_PUBLIC_IS_PRODUCTION === 'true'
) {
await fetch(process.env.NEXT_PUBLIC_ZAPIER_WEBHOOK_URL, {
await fetch(process.env.NEXT_PUBLIC_N8N_WEBHOOK_URL, {
method: 'POST',
body: JSON.stringify({
date: new Date().getTime(),
Expand Down

0 comments on commit 27e101d

Please sign in to comment.