PHPackages                             techigh/sendgo-notification - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. techigh/sendgo-notification

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

techigh/sendgo-notification
===========================

Notification Package for Laravel

1.1.0(1mo ago)0271↓100%MITPHPPHP &gt;=8.2

Since Aug 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/amuzcorp/sendgo-notification)[ Packagist](https://packagist.org/packages/techigh/sendgo-notification)[ RSS](/packages/techigh-sendgo-notification/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)DependenciesVersions (27)Used By (0)

SendGo Notification — Laravel 카카오톡·SMS 연동 패키지
=============================================

[](#sendgo-notification--laravel-카카오톡sms-연동-패키지)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Version](https://camo.githubusercontent.com/29eb1392e5ed4dd8d6cec232b0af38fbb19ae8e6ab2dc32a2ef9518f3fbc05cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e312d626c75652e737667)](https://github.com/amuzcorp/sendgo-notification/releases)[![Laravel](https://camo.githubusercontent.com/6f09ad2ed72565e697765b8d62cdb8ffd816fe05c9e922cc36c7df24649f0532/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382e78253230253743253230392e7825323025374325323031302e7825323025374325323031312e782d7265642e737667)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/789befc8d88593153c7b6252f5256360c9532b26eb84fcb39b1ab842cc239e9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d707572706c652e737667)](https://php.net)

Laravel에서 **카카오 알림톡**, **친구톡**, **SMS / LMS / MMS**를 전송하는 공식 Notification 패키지입니다. [SendGo.io](https://www.sendgo.io) API v1 / v2를 모두 지원합니다.

---

목차
--

[](#목차)

- [요구사항](#%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD)
- [설치](#%EC%84%A4%EC%B9%98)
- [환경 설정](#%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95)
- [사용 방법](#%EC%82%AC%EC%9A%A9-%EB%B0%A9%EB%B2%95)
    - [알림톡 (AlimTalk)](#%EC%95%8C%EB%A6%BC%ED%86%A1-alimtalk)
    - [친구톡 (FriendTalk)](#%EC%B9%9C%EA%B5%AC%ED%86%A1-friendtalk)
    - [SMS / LMS / MMS](#sms--lms--mms)
- [예외 처리](#%EC%98%88%EC%99%B8-%EC%B2%98%EB%A6%AC)
- [큐 비동기 발송](#%ED%81%90-%EB%B9%84%EB%8F%99%EA%B8%B0-%EB%B0%9C%EC%86%A1)
- [v1 → v2 마이그레이션](#v1--v2-%EB%A7%88%EC%9D%B4%EA%B7%B8%EB%A0%88%EC%9D%B4%EC%85%98)
- [에러 코드](#%EC%97%90%EB%9F%AC-%EC%BD%94%EB%93%9C)
- [트러블슈팅](#%ED%8A%B8%EB%9F%AC%EB%B8%94%EC%8A%88%ED%8C%85)

---

요구사항
----

[](#요구사항)

- **PHP** 8.2+
- **Laravel** 8.x | 9.x | 10.x | 11.x
- **SendGo 계정** ([sendgo.io](https://www.sendgo.io))

---

설치
--

[](#설치)

```
composer require techigh/sendgo-notification
```

설정 파일 발행 (선택):

```
php artisan vendor:publish --tag=sendgo
```

---

환경 설정
-----

[](#환경-설정)

`.env` 파일에 추가:

```
SENDGO_URL=https://api.sendgo.io
SENDGO_ACCESS_KEY=your_access_key
SENDGO_SECRET_KEY=your_secret_key
SENDGO_SENDER_KEY=your_sms_sender_key
SENDGO_KAKAO_SENDER_KEY=your_kakao_sender_key

# API 버전 (기본값: v1 / v2 사용 시 명시)
SENDGO_API_VERSION=v1
```

> API 키는 [SendGo.io](https://www.sendgo.io) 콘솔 → **연동 정보**에서 확인할 수 있습니다.

---

사용 방법
-----

[](#사용-방법)

### 알림톡 (AlimTalk)

[](#알림톡-alimtalk)

사전 승인된 템플릿으로 공식 비즈니스 메시지를 전송합니다.

```
use Techigh\SendgoNotification\Attributes\Alim\AlimTalkChannel;
use Techigh\SendgoNotification\Attributes\Alim\AlimTalkMessage;

class OrderConfirmedNotification extends Notification
{
    use Queueable;

    public function __construct(private readonly string $orderNumber) {}

    public function via(object $notifiable): array
    {
        return [AlimTalkChannel::class];
    }

    public function toAlim(object $notifiable): AlimTalkMessage
    {
        return AlimTalkMessage::make()
            ->templateCode('ORDER_CONFIRM_001')
            ->replaceSms('Y')
            ->smsTitle('[주문 확인]')
            ->smsContent("주문 {$this->orderNumber}이 확인되었습니다.")
            ->to([
                'contact' => $notifiable->phone,
                'name'    => $notifiable->name,
                'var1'    => $this->orderNumber,
            ])
            ->at();
    }
}
```

```
$user->notify(new OrderConfirmedNotification('ORD-20260101-001'));
```

#### AlimTalk 메서드

[](#alimtalk-메서드)

메서드필수설명`templateCode(string)`✅SendGo에서 승인받은 템플릿 코드`scheduleType(string)``'DIRECTLY'`(기본) 또는 `'SCHEDULED'``replaceSms(string)`알림톡 실패 시 SMS 대체 (`'N'` 기본)`smsTitle(string)`조건부대체 SMS 제목 (replaceSms `'Y'`일 때 필수)`smsContent(string)`조건부대체 SMS 내용 (replaceSms `'Y'`일 때 필수)`to(array)`✅수신자 정보 (`contact` 필수, `name` / `var1`~`var8` 선택)`at(string|null)`조건부예약 시각 (`SCHEDULED`일 때 필수, `Y-m-d H:i:s`)더 많은 예제 → [examples/AlimTalk.md](examples/AlimTalk.md)

---

### 친구톡 (FriendTalk)

[](#친구톡-friendtalk)

카카오톡 채널 친구에게 자유로운 형태의 메시지를 전송합니다.

```
use Techigh\SendgoNotification\Attributes\Friend\FriendTalkChannel;
use Techigh\SendgoNotification\Attributes\Friend\FriendTalkMessage;

class NewProductNotification extends Notification
{
    use Queueable;

    public function via(object $notifiable): array
    {
        return [FriendTalkChannel::class];
    }

    public function toFriend(object $notifiable): FriendTalkMessage
    {
        return FriendTalkMessage::make()
            ->messageType('FI')
            ->content("신상품 출시!\n\n{$this->product->name}\n{$this->product->price}원")
            ->imageUrl($this->product->image_url)
            ->imageLink($this->product->detail_url)
            ->buttons([
                [
                    'type'   => 'WL',
                    'name'   => '자세히 보기',
                    'linkMo' => $this->product->detail_url,
                    'linkPc' => $this->product->detail_url,
                ],
            ])
            ->to([
                'contact' => $notifiable->phone,
                'name'    => $notifiable->name,
            ])
            ->at();
    }
}
```

#### 메시지 타입

[](#메시지-타입)

타입설명`FT`텍스트형`FI`이미지형`FW`와이드 이미지형 (`wide('Y')` 필수)`FL`와이드 아이템 리스트형`FM`커머스형`FC`캐러셀 피드형`FA`캐러셀 커머스형`FP`프리미엄 동영상형#### FriendTalk 메서드

[](#friendtalk-메서드)

메서드필수설명`messageType(string)`✅메시지 타입`content(string)`✅메시지 내용`scheduleType(string)``'DIRECTLY'`(기본) 또는 `'SCHEDULED'``imageUrl(string)`이미지 URL`imageLink(string)`이미지 클릭 링크`buttons(array)`버튼 배열`wide(string)`조건부와이드 이미지 여부 (FW일 때 `'Y'` 필수)`adFlag(string)`광고성 메시지 표기 (`'N'` 기본)`replaceSms(string)`친구톡 실패 시 SMS 대체`smsTitle(string)`조건부대체 SMS 제목`smsContent(string)`조건부대체 SMS 내용`to(array)`✅수신자 정보`at(string|null)`조건부예약 시각더 많은 예제 → [examples/FriendTalk.md](examples/FriendTalk.md)

---

### SMS / LMS / MMS

[](#sms--lms--mms)

```
use Techigh\SendgoNotification\Attributes\Sms\SmsChannel;
use Techigh\SendgoNotification\Attributes\Sms\SmsMessage;

class VerificationNotification extends Notification
{
    use Queueable;

    public function __construct(private readonly string $code) {}

    public function via(object $notifiable): array
    {
        return [SmsChannel::class];
    }

    public function toSms(object $notifiable): SmsMessage
    {
        return SmsMessage::make()
            ->messageType('SMS')
            ->content("[인증번호] {$this->code} (3분 내 입력)")
            ->to([
                'contact' => $notifiable->phone,
                'name'    => $notifiable->name,
            ])
            ->at();
    }
}
```

**LMS** (장문, `subject` 필수):

```
return SmsMessage::make()
    ->messageType('LMS')
    ->subject('[점검 안내]')
    ->content('2026-04-01 02:00~06:00 서비스 점검이 예정되어 있습니다.')
    ->to(['contact' => $notifiable->phone])
    ->at();
```

**MMS** (`subject` + `files` 필수, 최대 3개):

```
return SmsMessage::make()
    ->messageType('MMS')
    ->subject('[이벤트]')
    ->content('첨부 이미지를 확인해주세요.')
    ->files([
        storage_path('app/public/event_01.jpg'),
        storage_path('app/public/event_02.jpg'),
    ])
    ->to(['contact' => $notifiable->phone])
    ->at();
```

#### SMS 메서드

[](#sms-메서드)

메서드필수설명`messageType(string)`✅`'SMS'` / `'LMS'` / `'MMS'``content(string)`✅메시지 내용`campaignType(string)``'MESSAGE'` (기본값)`scheduleType(string)``'DIRECTLY'`(기본) 또는 `'SCHEDULED'``subject(string)`조건부제목 (LMS / MMS 필수)`files(array)`조건부파일 경로 배열 (MMS 필수, 최대 3개)`to(array)`✅수신자 정보 (`contact` 필수, `var1`~`var8` 선택)`at(string|null)`조건부예약 시각더 많은 예제 → [examples/SMS.md](examples/SMS.md)

---

예외 처리
-----

[](#예외-처리)

모든 발송 실패는 `SendGoException`으로 던져집니다.

```
use Techigh\SendgoNotification\Exceptions\SendGoException;

try {
    $user->notify(new OrderConfirmedNotification($order->number));
} catch (SendGoException $e) {
    $ctx = $e->context();
    // $ctx['error_code']  — 에러 코드 (예: 'INVALID_TEMPLATE_CODE')
    // $ctx['status']      — HTTP 상태 코드
    // $ctx['endpoint']    — 호출 엔드포인트
    // $ctx['api_version'] — 사용 중인 API 버전
    // $ctx['body']        — 원본 응답 body

    logger()->error('SendGo 발송 실패', [
        'error_code' => $ctx['error_code'] ?? null,
        'status'     => $ctx['status'] ?? null,
        'message'    => $e->getMessage(),
    ]);
}
```

---

큐 비동기 발송
--------

[](#큐-비동기-발송)

`ShouldQueue`를 구현하면 Laravel 큐로 비동기 처리됩니다.

```
use Illuminate\Contracts\Queue\ShouldQueue;

class OrderConfirmedNotification extends Notification implements ShouldQueue
{
    use Queueable;

    public string $queue = 'notifications';
    public int $tries = 3;
    public int $backoff = 10;

    public function failed(SendGoException $e): void
    {
        logger()->critical('알림 최종 실패', ['error' => $e->getMessage()]);
    }
}
```

```
# 큐 워커 실행
php artisan queue:work --queue=notifications

# Redis 캐시 사용 권장 (다중 워커 환경)
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
```

> 다중 queue worker 환경에서는 `redis` 또는 `database` 캐시 드라이버를 사용해야 토큰 캐시가 공유됩니다.

---

v1 → v2 마이그레이션
--------------

[](#v1--v2-마이그레이션)

Notification 코드 변경 없이 `.env` 한 줄만 바꾸면 됩니다.

```
SENDGO_API_VERSION=v2
```

**v2 주요 차이점:**

항목v1v2토큰 형식base64 인코딩그대로 사용 (`sgv2.` prefix)토큰 재발급401/403 무조건 재발급에러 코드별 분기 (설정 오류는 재발급 안 함)에러 응답—`code` / `message` / `traceId` 포함v2 에러 코드 전체 목록 → [API\_V2\_ERROR\_CODES.md](API_V2_ERROR_CODES.md)

---

에러 코드
-----

[](#에러-코드)

`SendGoException::context()['error_code']`로 확인합니다.

### 인증 (401)

[](#인증-401)

코드설명`INVALID_AUTH_HEADER`Authorization 헤더 없음`INVALID_BASIC_AUTH`Basic 인증 형식 오류`INVALID_BASIC_AUTH_PAYLOAD`Basic 인증 페이로드 오류`INVALID_ACCESS_KEY`유효하지 않은 Access Key`INVALID_SECRET_KEY`유효하지 않은 Secret Key`INVALID_BEARER_TOKEN`Bearer 토큰 없음`INVALID_BEARER_TOKEN_PREFIX`Bearer 토큰 prefix 오류 (v2)`INVALID_BEARER_TOKEN_PAYLOAD`Bearer 토큰 페이로드 오류 (v2)`INVALID_BEARER_SIGNATURE`Bearer 토큰 서명 불일치 (v2)`INVALID_BEARER_APPLICATION`토큰에 해당하는 앱 없음 (v2)`MALFORMED_BEARER_TOKEN`잘못된 형식의 Bearer 토큰 (v2)`UNSUPPORTED_BEARER_TOKEN_VERSION`지원하지 않는 토큰 버전 (v2)`TOKEN_MISMATCH`발급된 토큰과 불일치 (v2)`TOKEN_EXPIRED`만료된 토큰 (자동 재발급 처리)`TOKEN_RECORD_NOT_FOUND`토큰 레코드 없음 (v2)### 권한 (403)

[](#권한-403)

코드설명`ACCESS_KEY_NOT_APPROVED`미승인 Access Key`IP_NOT_ALLOWED`허용되지 않은 IP`TEAM_REQUIRED_FOR_KAKAO`카카오 API는 팀 소속 앱만 사용 가능`SENDER_APPLICATION_MISMATCH`SMS 발신키가 앱과 불일치`KAKAO_SENDER_APPLICATION_MISMATCH`카카오 발신키가 앱과 불일치### 리소스 (404)

[](#리소스-404)

코드설명`INVALID_SENDER_KEY`유효하지 않은 SMS 발신키`INVALID_KAKAO_SENDER_KEY`유효하지 않은 카카오 발신키`INVALID_TEMPLATE_CODE`유효하지 않은 템플릿 코드`OWNER_NOT_FOUND`캠페인 소유자 확인 불가`SENDER_OWNER_NOT_FOUND`SMS 발신키 소유자 확인 불가`KAKAO_SENDER_OWNER_NOT_FOUND`카카오 발신키 소유자 확인 불가### 요청 (422)

[](#요청-422)

코드설명`EMPTY_CONTACTS`수신자 없음`PAYMENT_REQUIRED`크레딧 부족`MESSAGE_PROCESSING_FAILED`SMS/MMS 처리 실패`NOTICE_PROCESSING_FAILED`알림톡 처리 실패`FRIEND_PROCESSING_FAILED`친구톡 처리 실패### 패키지 내부

[](#패키지-내부)

코드설명`INVALID_API_VERSION`지원하지 않는 API 버전v2 에러 코드 상세 → [API\_V2\_ERROR\_CODES.md](API_V2_ERROR_CODES.md)

---

트러블슈팅
-----

[](#트러블슈팅)

**메시지가 전송되지 않을 때**

1. `.env` API 키 확인
2. SendGo 계정 잔액 확인
3. 전화번호 형식 확인 (`01012345678`, 하이픈 제외)
4. `storage/logs/laravel.log` 에러 확인

**알림톡이 SMS로 대체 발송될 때**

1. SendGo에서 템플릿 승인 상태 확인
2. 템플릿 변수 매핑 확인
3. 카카오 채널 연동 상태 확인

**다중 워커에서 토큰 충돌이 발생할 때**

- `CACHE_DRIVER=redis`로 변경 (공유 캐시 필수)

**`INVALID_API_VERSION` 에러**

- `SENDGO_API_VERSION` 값이 `v1` 또는 `v2`인지 확인

---

라이선스
----

[](#라이선스)

MIT — [LICENSE](LICENSE) 참조

---

**Made with ❤️ by [Techigh](https://github.com/techigh) | Powered by [SendGo.io](https://www.sendgo.io)**

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Recently: every ~42 days

Total

25

Last Release

50d ago

Major Versions

0.0.9 → 1.0.02025-02-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b919a20a941e8ee68f44be4ae563adc47b8de9fa6a116bc1f30d1ef5add7929?d=identicon)[taekwanpark](/maintainers/taekwanpark)

---

Top Contributors

[![taekwanpark](https://avatars.githubusercontent.com/u/112610029?v=4)](https://github.com/taekwanpark "taekwanpark (30 commits)")[![jeongjwon](https://avatars.githubusercontent.com/u/76391160?v=4)](https://github.com/jeongjwon "jeongjwon (3 commits)")[![XisoDev](https://avatars.githubusercontent.com/u/10387955?v=4)](https://github.com/XisoDev "XisoDev (1 commits)")

---

Tags

messagelaravelnotificationkakao

### Embed Badge

![Health badge](/badges/techigh-sendgo-notification/health.svg)

```
[![Health](https://phpackages.com/badges/techigh-sendgo-notification/health.svg)](https://phpackages.com/packages/techigh-sendgo-notification)
```

###  Alternatives

[bpocallaghan/alert

A helper package to flash a bootstrap alert to the browser.

1819.6k3](/packages/bpocallaghan-alert)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
