Tajo 사전 이용 신청

이름과 이메일 주소 또는 전화번호를 입력해 주세요. Tajo 이용 방법을 안내해 드립니다.

이메일 발송

/v3/smtp/email 엔드포인트를 사용하여 개별 트랜잭션 이메일을 발송합니다.

엔드포인트

POST /v3/smtp/email

요청 본문

기본 이메일

{
"sender": {
"name": "Your App",
"email": "[email protected]"
},
"to": [
{
"email": "[email protected]",
"name": "John Doe"
}
],
"subject": "Welcome to our service!",
"htmlContent": "<html><body><h1>Welcome!</h1><p>Thank you for signing up.</p></body></html>"
}

고급 이메일

{
"sender": {
"name": "Your App",
"email": "[email protected]"
},
"to": [
{
"email": "[email protected]",
"name": "John Doe"
}
],
"cc": [
{
"email": "[email protected]",
"name": "CC User"
}
],
"bcc": [
{
"email": "[email protected]"
}
],
"subject": "Order Confirmation #{{order_id}}",
"htmlContent": "<html><body><h1>Order Confirmed</h1><p>Your order {{order_id}} has been confirmed.</p></body></html>",
"textContent": "Your order {{order_id}} has been confirmed.",
"params": {
"order_id": "12345"
},
"tags": ["transactional", "order-confirmation"],
"headers": {
"X-Custom-Header": "custom-value"
}
}

코드 예제

JavaScript/Node.js

const brevo = require('@getbrevo/brevo');
const apiInstance = new brevo.TransactionalEmailsApi();
apiInstance.setApiKey(brevo.TransactionalEmailsApiApiKeys.apiKey, process.env.BREVO_API_KEY);
const sendEmail = async () => {
const sendSmtpEmail = new brevo.SendSmtpEmail();
sendSmtpEmail.subject = "Welcome to our service!";
sendSmtpEmail.htmlContent = "<html><body><h1>Welcome!</h1></body></html>";
sendSmtpEmail.sender = { name: "Your App", email: "[email protected]" };
sendSmtpEmail.to = [{ email: "[email protected]", name: "John Doe" }];
try {
const result = await apiInstance.sendTransacEmail(sendSmtpEmail);
console.log('Email sent:', result);
return result;
} catch (error) {
console.error('Error sending email:', error);
throw error;
}
};

Python

import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration))
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(
to=[{"email": "[email protected]", "name": "John Doe"}],
sender={"name": "Your App", "email": "[email protected]"},
subject="Welcome to our service!",
html_content="<html><body><h1>Welcome!</h1></body></html>"
)
try:
api_response = api_instance.send_transac_email(send_smtp_email)
print(api_response)
except ApiException as e:
print("Exception when calling TransactionalEmailsApi->send_transac_email: %s\n" % e)

cURL

Terminal window
curl -X POST "https://api.brevo.com/v3/smtp/email" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "api-key: YOUR_API_KEY" \
-d '{
"sender": {
"name": "Your App",
"email": "[email protected]"
},
"to": [
{
"email": "[email protected]",
"name": "John Doe"
}
],
"subject": "Welcome to our service!",
"htmlContent": "<html><body><h1>Welcome!</h1></body></html>"
}'

응답

성공 응답 (201 Created)

{
"messageId": "<[email protected]>"
}

오류 응답

잘못된 API 키 (401)

{
"code": "unauthorized",
"message": "Invalid API key provided"
}

잘못된 이메일 형식 (400)

{
"code": "invalid_parameter",
"message": "Invalid email format in 'to' field"
}

요청 한도 초과 (429)

{
"code": "too_many_requests",
"message": "Rate limit exceeded"
}

파라미터

필수 파라미터

파라미터유형설명
senderobject발신자 정보
toarray수신자 객체 배열
subjectstring이메일 제목

선택 파라미터

파라미터유형설명
htmlContentstring이메일 본문에 사용할 HTML 콘텐츠
textContentstring이메일 본문에 사용할 텍스트 콘텐츠
ccarray참조 수신자
bccarray숨은 참조 수신자
replyToobject회신 주소
attachmentsarray첨부 파일
paramsobject템플릿 파라미터
tagsarray추적용 이메일 태그
headersobject사용자 지정 헤더

템플릿 변수

이메일 제목과 콘텐츠 안에서 템플릿 변수를 사용할 수 있습니다.

{
"subject": "Welcome {{firstName}}!",
"htmlContent": "<h1>Hello {{firstName}} {{lastName}}</h1>",
"params": {
"firstName": "John",
"lastName": "Doe"
}
}

첨부 파일

다음과 같이 요청 본문에 첨부 파일을 포함할 수 있습니다.

{
"attachments": [
{
"content": "base64_encoded_content",
"name": "invoice.pdf"
},
{
"url": "https://example.com/document.pdf",
"name": "document.pdf"
}
]
}

모범 사례

  1. 도달률을 높이려면 HTML과 텍스트 콘텐츠를 항상 함께 포함하십시오
  2. 콘텐츠를 문자열로 이어 붙이는 대신 템플릿 변수를 사용하십시오
  3. 스팸 필터를 피하려면 정확한 발신자 정보를 포함하십시오
  4. 추적과 분석을 위해 태그를 추가하십시오
  5. 발송하기 전에 이메일 주소가 유효한지 검증하십시오
  6. 재시도 로직으로 오류를 안정적으로 처리하십시오

요청 한도

  • 무료 계정: 하루 300건 이메일
  • 유료 계정: 요금제에 따름
  • 버스트 한도: 분당 100건 이메일

추적

이 엔드포인트로 발송한 이메일은 다음 항목이 자동으로 추적됩니다.

  • 전달 상태
  • 열람률
  • 클릭 추적
  • 반송 처리

자세한 분석은 Brevo 대시보드의 통계트랜잭션에서 확인하십시오.

관련 엔드포인트

Tajo 사전 이용 신청

이름과 이메일 주소 또는 전화번호를 입력해 주세요. Tajo 이용 방법을 안내해 드립니다.

자동 감지
AI 어시스턴트

안녕하세요! 문서에 대해 무엇이든 물어보세요.