결제 이벤트가 발생할 때 유료 고객을 MailerLite 구독자 목록에 자동으로 동기화합니다. 고객을 특정 그룹에 추가하고, 자동화 워크플로를 트리거하며, 실제 결제 데이터를 기반으로 이메일 마케팅 목록을 최신 상태로 유지합니다.
MailerLite는 뉴스레터, 캠페인 및 자동화를 위한 강력한 이메일 마케팅 플랫폼입니다. 이 통합은 결제 활동에 따라 구독자를 자동으로 관리하는 데 도움을 줍니다 - 온보딩 시퀀스, 고객 세분화 및 타겟 마케팅 캠페인에 적합합니다.
시작하기
Open the Webhook Section
Dodo Payments 대시보드에서 Webhooks + Add Endpoint 로 이동한 후 통합 드롭다운을 확장합니다.
Select MailerLite
MailerLite 통합 카드를 선택합니다.
Enter API Key
구성에서 MailerLite API 키를 입력합니다.
Configure Transformation
구독자 데이터를 MailerLite의 API 형식에 맞게 변환하도록 변환 코드를 편집합니다.
Test & Create
샘플 페이로드로 테스트한 다음 Create 를 클릭하여 구독자 동기화를 활성화합니다.
Done!
결제 이벤트가 이제 자동으로 고객을 MailerLite 목록에 동기화합니다.
변환 코드 예제
성공적인 결제 시 고객 추가
function handler ( webhook ) {
if ( webhook . eventType === "payment.succeeded" ) {
const p = webhook . payload . data ;
webhook . url = "https://connect.mailerlite.com/api/subscribers" ;
webhook . payload = {
email: p . customer . email ,
fields: {
name: p . customer . name ,
company: p . customer . business_name || "" ,
last_name: ""
},
groups: [ "your-group-id-here" ],
status: "active"
};
}
return webhook ;
}
See all 17 lines
제품에 따라 여러 그룹에 구독자 추가
function handler ( webhook ) {
if ( webhook . eventType === "payment.succeeded" ) {
const p = webhook . payload . data ;
// Determine groups based on product or amount
const groups = [ "customers-group-id" ];
// Add to premium group if high-value purchase
if ( p . total_amount >= 10000 ) { // $100+
groups . push ( "premium-customers-group-id" );
}
webhook . url = "https://connect.mailerlite.com/api/subscribers" ;
webhook . payload = {
email: p . customer . email ,
fields: {
name: p . customer . name ,
last_purchase_amount: ( p . total_amount / 100 ). toFixed ( 2 ),
last_purchase_date: new Date ( webhook . payload . timestamp ). toISOString (). split ( 'T' )[ 0 ],
payment_id: p . payment_id
},
groups: groups ,
status: "active"
};
}
return webhook ;
}
See all 27 lines
구독 활성화 시 새로운 구독자 추가
subscription_subscriber.js
function handler ( webhook ) {
if ( webhook . eventType === "subscription.active" ) {
const s = webhook . payload . data ;
webhook . url = "https://connect.mailerlite.com/api/subscribers" ;
webhook . payload = {
email: s . customer . email ,
fields: {
name: s . customer . name ,
subscription_plan: s . product_id ,
subscription_amount: ( s . recurring_pre_tax_amount / 100 ). toFixed ( 2 ),
billing_frequency: s . payment_frequency_interval ,
subscription_start: new Date (). toISOString (). split ( 'T' )[ 0 ]
},
groups: [ "subscribers-group-id" , "active-subscriptions-group-id" ],
status: "active"
};
}
return webhook ;
}
See all 19 lines
구독 취소 시 구독자 업데이트
subscription_cancelled.js
function handler ( webhook ) {
if ( webhook . eventType === "subscription.cancelled" ) {
const s = webhook . payload . data ;
// Use PUT to update existing subscriber
webhook . url = "https://connect.mailerlite.com/api/subscribers/" + encodeURIComponent ( s . customer . email );
webhook . method = "PUT" ;
webhook . payload = {
fields: {
subscription_status: "cancelled" ,
cancellation_date: new Date (). toISOString (). split ( 'T' )[ 0 ]
},
groups: [ "churned-customers-group-id" ]
};
}
return webhook ;
}
See all 16 lines
사용자 정의 필드로 고객 추가
function handler ( webhook ) {
if ( webhook . eventType === "payment.succeeded" ) {
const p = webhook . payload . data ;
webhook . url = "https://connect.mailerlite.com/api/subscribers" ;
webhook . payload = {
email: p . customer . email ,
fields: {
name: p . customer . name ,
company: p . customer . business_name || "" ,
country: p . customer . country || "" ,
city: p . customer . city || "" ,
phone: p . customer . phone || "" ,
// Custom fields (must be created in MailerLite first)
total_spent: ( p . total_amount / 100 ). toFixed ( 2 ),
customer_since: new Date (). toISOString (). split ( 'T' )[ 0 ],
payment_method: p . payment_method || "unknown" ,
currency: p . currency || "USD"
},
groups: [ "paying-customers-group-id" ],
status: "active" ,
subscribed_at: new Date (). toISOString (). replace ( 'T' , ' ' ). split ( '.' )[ 0 ]
};
}
return webhook ;
}
See all 25 lines
이벤트를 통한 자동화 트리거
function handler ( webhook ) {
if ( webhook . eventType === "payment.succeeded" ) {
const p = webhook . payload . data ;
// First, ensure subscriber exists
webhook . url = "https://connect.mailerlite.com/api/subscribers" ;
webhook . payload = {
email: p . customer . email ,
fields: {
name: p . customer . name ,
// Add a trigger field that your automation watches
last_payment_trigger: new Date (). toISOString (),
last_payment_amount: ( p . total_amount / 100 ). toFixed ( 2 )
},
status: "active"
};
// Tip: Create an automation in MailerLite that triggers
// when 'last_payment_trigger' field is updated
}
return webhook ;
}
See all 22 lines
변환에서 사용하기 전에 MailerLite에서 사용자 정의 필드를 생성하세요.
그룹을 사용하여 제품, 요금제 또는 구매 행동에 따라 고객을 세분화하세요.
MailerLite에서 필드 업데이트에 따라 트리거되는 자동화 워크플로를 설정하세요.
중복 구독자 오류를 피하기 위해 upsert 동작(POST to /subscribers)을 사용하세요.
더 나은 고객 통찰력을 위해 결제 메타데이터를 사용자 정의 필드에 저장하세요.
모든 결제에 대해 활성화하기 전에 소규모 그룹으로 테스트하세요.
사용자 정의 필드 설정
사용자 정의 필드를 사용하기 전에 MailerLite에서 생성해야 합니다:
MailerLite 대시보드로 이동
Subscribers Fields 로 이동
Create field 를 클릭한 다음 다음과 같은 필드를 추가합니다:
total_spent (숫자)
customer_since (날짜)
subscription_plan (텍스트)
payment_method (텍스트)
last_payment_amount (숫자)
문제 해결
Subscribers not being added
API 키가 정확하고 활성화되어 있는지 확인하세요
이메일 주소가 유효한지(RFC 2821 준수) 확인하세요
그룹 ID가 정확하고 계정에 존재하는지 확인하세요
참고: 수신 거부되었거나 반송되었거나 정크로 분류된 구독자는 API로 다시 활성화할 수 없습니다
Custom fields not updating
MailerLite에 사용자 지정 필드가 있는지 확인한 후 사용하세요
필드 이름이 정확하게 일치하는지(대소문자 구분) 확인하세요
필드 값이 예상되는 유형(텍스트, 숫자, 날짜)에 맞는지 확인하세요
MailerLite API는 분당 120개의 요청으로 속도 제한이 있습니다
많은 구독자를 처리하는 경우 일괄 처리 엔드포인트를 사용하세요
고부하 시나리오에서는 백오프 전략을 구현하세요
Group assignment not working
그룹 ID가 숫자 문자열인지 확인하세요
그룹이 MailerLite 계정에 존재하는지 확인하세요
참고: 그룹과 함께 PUT을 사용하면 목록에 없는 그룹에서 구독자가 제거됩니다
API 참조
MailerLite 구독자 API는 다음 주요 매개변수를 수락합니다:
매개변수 유형 필수 설명 emailstring Yes 유효한 이메일 주소(RFC 2821) fieldsobject No 필드 이름/값 쌍이 있는 객체 fields.namestring No 구독자의 이름 fields.last_namestring No 구독자의 성 fields.companystring No 회사 이름 fields.countrystring No 국가 fields.citystring No 도시 fields.phonestring No 전화번호 groupsarray No 구독자를 추가할 그룹 ID 배열 statusstring No 다음 값 중 하나: active, unsubscribed, unconfirmed, bounced, junk subscribed_atstring No 형식 yyyy-MM-dd HH:mm:ss의 날짜 ip_addressstring No 구독자의 IP 주소
완전한 API 문서는 MailerLite Developers 를 방문하세요. Last modified on February 27, 2026