지식 베이스

Connect your website to Zinn® Campaigns: Node.js, Next.js and Moodle

Send every sign-up from your own site into Zinn® Campaigns with our npm package or our Moodle plugin. Each lead arrives labelled with the platform and the form, with its consent.

Zinn®, 우리의 바이킹이 하나가 열려 있는 글 목록 옆에서 체크리스트를 읽고 있습니다.

Zinn® Campaigns can take sign-ups straight from your own website, wherever it is hosted. You create a site key, add one of our connectors, and every form sign-up arrives in Zinn® Campaigns as a contact. Public page: https://zinndigital.com/campaigns/integrations

1. Create a site key

In your dashboard open Campaigns → Connect a website and create a key for the site. The key starts with zcs_. Keep it on your server: it never goes into a page a visitor loads. Store it as an environment variable, for example ZINN_CAMPAIGNS_SITE_KEY.

2. Add a connector

Next.js

Install the package with npm install @zinn-digital/campaigns and add a route handler:

// app/api/newsletter/route.ts
import { createLeadRoute } from "@zinn-digital/campaigns/next";

export const { POST } = createLeadRoute({
  siteKey: process.env.ZINN_CAMPAIGNS_SITE_KEY!,
  form: "Newsletter",
});

A server action is available too (createLeadAction()). The labels are set on the server, so a visitor cannot change them.

Node.js, Express and Fastify

import express from "express";
import { zinnLeadsExpress } from "@zinn-digital/campaigns/node";

const app = express();
app.post(
  "/newsletter",
  express.urlencoded({ extended: false }),
  zinnLeadsExpress({ siteKey: process.env.ZINN_CAMPAIGNS_SITE_KEY!, form: "Newsletter" }),
);

Fastify uses zinnLeadsFastify() with the same options. Any other framework can call createLeadHandler() with the posted form fields.

React form

@zinn-digital/campaigns/react has a ready sign-up form with English and Arabic text, right-to-left ready. It posts to your own route, and your route adds the key.

Moodle

Install the Zinn® Campaigns for Moodle plugin (local_zinncampaigns) from your dashboard, under Plugins and modules. Go to Site administration → Plugins → Local plugins → Zinn® Campaigns, paste the site key and choose what to send: new sign-ups, course enrolments or both. Leads are sent in the background by Moodle's task runner, so a slow network never slows a sign-up. Each enrolment is labelled with the course name.

Any other site

Post the lead to https://api.zinndigital.com/v1/public/email-marketing/connect/leads with Authorization: Bearer <site key> and a JSON body with at least email. Send an Idempotency-Key header so a retry never makes a duplicate.

3. Labels, source and consent

Every lead is labelled with the platform and the form, such as Next.js: Newsletter or Moodle: Introduction to Biology. The platforms are:

  • Node
  • Next.js
  • Moodle

You can add your own labels as well (up to 20), so you always know which site and form a contact came from.

Send the consent box and the exact text the visitor agreed to. Both are stored with the contact. An address that unsubscribed or bounced is never added back.

What the API answers

  • 201 — the lead was accepted (a new contact, a contact who joined a list, or an address that is suppressed and was left alone).
  • 200 with duplicate — the same idempotency key was already used; nothing changed.
  • 401 — the site key is wrong or was removed. Create a new one.
  • 403 — the site is not connected yet, or the connection was turned off.
  • 429 — too many leads at once. Wait for the number of seconds in Retry-After.

The npm package and the Moodle plugin handle each of these for you.

이 문서는 아직 귀하의 언어로 번역되지 않아 영어 버전을 읽고 계십니다.

블로그 최신 글

호스팅, SEO 및 대규모 사이트 운영에 대해 작성한 글입니다.

호스팅 계층에서의 SEO 및 링크 빌딩: 2026년 운영자의 관점

2026년 호스팅이 색인 생성과 링크 자산에 미치는 영향: 페이지의 색인 상태 유지, 구축 전 기존 도메인 검증, 검색 엔진 흔적 없는 링크 빌딩, 그리고 인프라가 SEO를 위해 할 수 있는 것과 할 수 없는 것에 대한 솔직한 분석.

게시물 읽기 →

WordPress를 빠르고 안전하게 만들기: 성능 및 플러그인 체크리스트

빠르고 안전한 WordPress를 위한 실용적인 체크리스트: 서버 수준 캐싱, 사이트별 객체 캐시, 사용할 가치가 있는 소수의 플러그인, 최신 스택 유지, 그리고 절대 캐시해서는 안 되는 WooCommerce 페이지.

게시물 읽기 →

2026년 관리형 웹 호스팅을 선택하는 방법: 구매자 가이드

제어판이 있는 저렴한 서버와 우수한 매니지드 호스팅을 실제로 구분 짓는 요소(마이그레이션, 백업, 격리, 진정한 캐싱 및 정직한 확장성), 그리고 계약하기 전에 이를 평가하는 방법.

게시물 읽기 →

블로그 읽기 →

아직 해결되지 않았나요?

모든 요금제에 지원 서비스가 포함되어 있으며, 고객센터는 하루 24시간 열려 있습니다. 또한 58개의 지원 언어 중 편하신 언어로 문의해 주시면 고객님의 언어로 답변해 드립니다.

지원팀에 문의 모든 글