> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-email-nhn.md).

# Send Email via Webhook (NHN Cloud)

{% hint style="info" %}
This guide explains how to build an email send webhook campaign using the [NHN Email Send API](https://docs.nhncloud.com/ko/Notification/Email/ko/Overview/).
{% endhint %}

### Prerequisites

Preliminary preparation is required for normal bulk email sending.

This step directly affects send success rates and domain reputation.

#### 1. Activate NHN Cloud Email Service

NHN Cloud registration and Email service activation in the console is required.

Check the `appKey` and `X-Secret-Key` in the NHN Cloud console.

#### 2. Sender Domain Authentication (Domain Authentication)

{% hint style="danger" %}
Since February 1, 2024, the [Gmail sender guidelines](https://support.google.com/a/answer/81126?hl=ko\&visit_id=638991354205057328-2084985656\&rd=1#requirements-5k\&zippy=%2C%ED%95%98%EB%A3%A8%EC%97%90-%EA%B0%9C-%EC%9D%B4%EC%83%81%EC%9D%98-%EB%A9%94%EC%9D%BC%EC%9D%84-%EC%A0%84%EC%86%A1%ED%95%98%EA%B8%B0-%EC%9C%84%ED%95%9C-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD) have changed.

If domain authentication and SPF, DKIM, DMARC authentication are not completed, sending to gmail.com and yahoo.com domains may be rejected.
{% endhint %}

This is the most important step for bulk sending.

Domain authentication is essential for spam prevention, delivery rate improvement, and securing bulk sending permissions.\
When using NHN Cloud, after registering the domain, you must configure the following DNS values.

* SPF (Sender Policy Framework)
* DKIM (DomainKeys Identified Mail)
* Return-Path (Bounce Domain)

**SPF (Sender Policy Framework)**

SPF is a DNS record that verifies the trustworthiness of the email sending server.\
It is a setting that authorizes the NHN server to send mail on behalf of your domain.

`DNS Type: TXT`

Example:

```
v=spf1 include:mail.nhncloudservice.com ~all
```

**DKIM (DomainKeys Identified Mail)**

DKIM is a method that adds a digital signature to emails to prevent sender forgery and tampering during transmission.\
You can check the DKIM public key in the NHN console.

`DNS Type: TXT`

Example:

```
selector._domainkey.example.com  IN TXT  "v=DKIM1; k=rsa; p=public_key..."
```

**Return-Path (Bounce Domain)**

Setting up the return mail reception path is also important.\
NHN Cloud provides a separate Return-Path domain, and this must be configured as a `CNAME`.

Example:

```
rp.example.com  CNAME  bounce.nhncloudservice.com
```

#### 3. Register Sender Email Address (Verified Sender)

The domain and address from which to send email must be registered in the NHN console.

DKIM and SPF must be configured for the sender address to be properly verified.

Example:

```
no-reply@yourdomain.com
```

#### 4. Prepare Recipient Data

To send emails via Hackle webhook, the following user properties must be collected.

* `email`
* `name` (optional)

If there are many incorrect email addresses, send restrictions may be imposed.\
We recommend managing email address format validation and collection integrity together.

### Configure the Webhook

Follow the steps below to set up the email send webhook.

{% stepper %}
{% step %}
**Create a Webhook Campaign**

Click the `Webhook` menu in the Hackle Dashboard, then click the `Create` button.

Next, enter the desired campaign name to create it.
{% endstep %}

{% step %}
**Configure Request Information**

**URL Settings**

Enter the HTTP Method and URL according to the NHN Email Send API.

![](/files/NGkDRPyLsNFSVobGMcZG)

**Header Settings**

Click the `Add` button in the `Headers` tab and enter the values.

If you need to use different tokens per target user, you can use personalization.

* Key: `Authorization`
* Value: `{{user_properties.authorization_type}} {{user_properties.access_token}}`

![](/files/0062EvMIroUtqazlGV0k)

{% hint style="info" %}
You can insert personalization values using the `{...}` button.

You can use stored user properties or event properties to dynamically inject user-specific token values.
{% endhint %}
{% endstep %}

{% step %}
**Body Settings**

Set the `Body` tab to JSON mode and write it according to the NHN `General Email Send` Request Body specification.

![](/files/3ioLLa2oBsJ527Hstg2f)

**Write Title and Body Directly**

{% hint style="info" %}
You can also insert personalization values inside the title and body.

For example, you can insert values such as name, registration date, and product name individually for each user.
{% endhint %}

```json
{
  "senderAddress": "no-reply@yourservice.com",
  "senderName": "YourService",
  "title": "회원가입이 완료되었습니다",
  "body": "안녕하세요  {{user_properties["name"] | default: "회원"}}님,\n회원가입을 환영합니다!",
  "receiverList": [
    {
      "receiveMailAddr": "{{user_properties["email"] | default: ""}}",
      "receiveName": "{{user_properties["name"] | default: "회원"}}",
      "receiveType": "MRT0"
    }
  ],
  "userId": "hackle-webhook",
  "statsId": "hackle-email"
}
```

* `receiveType` is typically fixed as `MRT0` when sending to the recipient themselves.
* `userId` and `statsId` are fields for NHN statistics. They can be managed as fixed strings.

**Using NHN Templates**

{% hint style="info" %}
Define replacement keys such as `##user_name##` and `##signup_date##` in the NHN template body and title, and match them with `templateParameter`.

Using properties like `user_properties["signup_date"]` makes it easy to include information such as registration date, purchase amount, and product name.
{% endhint %}

If you have pre-registered a template in the NHN console, you can manage it more cleanly using `templateId` and `templateParameter`.

```json
{
  "templateId": "WELCOME_TEMPLATE",
  "templateParameter": {
    "user_name": "{{ user_properties[\"name\"] | default: \"회원\" }}",
    "signup_date": "{{ user_properties[\"signup_date\"] | default: \"\" }}"
  },
  "receiverList": [
    {
      "receiveMailAddr": "{{ user_properties[\"email\"] | default: \"\" }}",
      "receiveName": "{{ user_properties[\"name\"] | default: \"\" }}",
      "receiveType": "MRT0"
    }
  ],
  "userId": "hackle-webhook",
  "statsId": "hackle-email-template"
}

```

* `receiveType` is typically fixed as `MRT0` when sending to the recipient themselves.
* `userId` and `statsId` are fields for NHN statistics. They can be managed as fixed strings.
  {% endstep %}

{% step %}
**Target Settings**

Configure the cohort to be the webhook send target.

![](/files/gnKlHf7XZgJdzTd1F6lZ)

{% hint style="warning" %}
If `receiveMailAddr` is empty, the NHN API may return an error.

We recommend filtering in the webhook campaign target conditions so that only users with an email property are included.
{% endhint %}
{% endstep %}

{% step %}
**Send Settings**

Once you save the campaign settings, you can see the following summary information.

![](/files/llxIHr1LccnxCBO4ssG6)

Now configure the desired send conditions.

For example, methods such as `Schedule-based` and `Event-based`.

You can also check information about the estimated send target on the send settings screen.

Configure the send type and customer fatigue management, then click `Start` to activate the campaign.

![](/files/KSF2ZfUpMPzQHb6AgxUf)
{% endstep %}

{% step %}
**Complete**

The email webhook campaign activation is complete.

Track the campaign performance on the statistics screen.

![](/files/f4IIF7ceyuRPxIhA7LhY)
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-email-nhn.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
