Version: v5.0.1+incompatible Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2020 License: MIT



Twitter Follow

Official Go Library for Pepipost

This library contains methods for easily interacting with the Pepipost Email Sending API to send emails within few seconds.

We are trying to make our libraries Community Driven- which means we need your help in building the right things in proper order we would request you to help us by sharing comments, creating new issues or pull requests.

We welcome any sort of contribution to this library.

The latest 5.0.0 version of this library provides is fully compatible with the latest Pepipost v5.0 API.

For any update of this library check Releases.

Table of Content


  • In order to successfully build and run your SDK files, you are required to have the following Prerequisites in you system:


  • GO (visit Go installation page for details on how to install Go)
  • Ensure that GOROOT & GOPATH enviroment variable is set in the system variables. if not, set it to your working directory where you add your Go projects.

Quick Start

Quick guide for installing Pepipost Go library

  • Check GOPATH using below command

    echo $GOPATH


  • Change your directory to $GOPATH

    cd $GOPATH

  • make project using below command

    mkdir $GOPATH/src/pepipost_test && cd $GOPATH/src/


  • Clone or download the repository using below command

    git clone


    Download zip

  • Create sample Go file named main.go in

cd $GOPATH/src/pepipost_test

copy the below sample example in your main.go file.

  • Change your api-key and sending domain respectively

    • apikey will be available under Login to Pepipost -> Settings -> Integration
    • Sending Domain will be available under Login to Pepiost -> Settings -> Sending Domains
    *Note :: Domains showing with Active status on Sending Domain dashboard are only allowed to send any sort of emails.* In case there are no Sending Domain added under your account, then first add the domain, get the DNS (SPF/DKIM) settings done and get it reviewed by our compliance team for approval. Once the domain is approved, it will be in ACTIVE status and will be ready to send any sort of emails. 
  • Sending first email using Go library

    go build main.go

    ./main.exe (for windows) OR ./main


Sample Example

package main


func main(){

  APIKey := "your api_key here"

  client := PepipostClient.NewPEPIPOST()
  send := client.Send()

  setApikey := client.Configuration()

  fromEmail := "hello@your-registered-domain-with-pepipost"
  fromName := "Pepipost"
  htmlBody := "<html><body>Hello [%NAME%], Email testing is successful. <br> Hope you enjoyed this integration. <br></html>"
  trueValue := true
  falseValue := false
  toName := "to-address"
  toEmail := ""

  Body := &models_pkg.Send{}

  Body.From = models_pkg.From{}
  Body.From.Email = &fromEmail
  Body.From.Name = &fromName

  Body.Subject = "Pepipost Test Email from GOlang SDK"
  Body.Content = make([]*models_pkg.Content,1)
  Body.Content[0] = &models_pkg.Content{}
  Body.Content[0].Type = models_pkg.Type_HTML
  Body.Content[0].Value = &htmlBody

  Body.Personalizations = make([]*models_pkg.Personalizations,1)
  Body.Personalizations[0] = &models_pkg.Personalizations{}

  var input interface{}
  Body.Personalizations[0].To = make([]*models_pkg.EmailStruct,1)
  Body.Personalizations[0].To[0] = &models_pkg.EmailStruct{}
  Body.Personalizations[0].To[0].Name = &toName
  Body.Personalizations[0].To[0].Email = &toEmail

  Body.Settings = &models_pkg.Settings{}
  Body.Settings.Footer = &trueValue
  Body.Settings.ClickTrack = &trueValue
  Body.Settings.OpenTrack = &falseValue
  Body.Settings.UnsubscribeTrack = &trueValue

  Body.Tags = &[]string{ "campaign" }

  var err error
  var result []string

  result, err = send.CreateGenerateTheMailSendRequest(Body)

  if err != nil{
    //TODO: Use err variable here
    //TODO: Use result variable here


v5.0.0 has been released! Please see the release notes for details.

All updates to this library are documented in our releases. For any queries, feel free to reach out us at


If you are interested in the future direction of this project, please take a look at our open issues and pull requests. We would love to hear your feedback.


pepipost-sdk-go library is guided and supported by the Pepipost Developer Experience Team . This pepipost library is maintained and funded by Pepipost Ltd. The names and logos for pepipost are trademarks of Pepipost Ltd.


This code library was semi-automatically generated by APIMATIC v2.0 and licensed under The MIT License (MIT).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL