controllers

package
v0.0.0-...-87773b3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Email string `json:"email"`
}

type EmailList

type EmailList struct {
	Emails []string `json:"emails"`
}

type MarketingController

type MarketingController struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string, router *mux.Router) MarketingController

New creates a new MarketingController responsible for marketing endpoints

func (*MarketingController) AddAllControllers

func (m *MarketingController) AddAllControllers(router *mux.Router)

func (*MarketingController) AddRecipientToWaitingList

func (m *MarketingController) AddRecipientToWaitingList(recipientID string) error

func (*MarketingController) Addrecipients

func (u *MarketingController) Addrecipients(email string) error

Addrecipients : Add recipients POST /contactdb/recipients

func (*MarketingController) GetIDfromEmail

func (m *MarketingController) GetIDfromEmail(email string) (string, error)

GetIDfromEmail : Get ID from email

{
  "result": {
    "jane_doe@example.com": {
      "contact": {
        "address_line_1": "",
        "address_line_2": "",
        "alternate_emails": [
          "janedoe@example1.com"
        ],
        "city": "",
        "country": "",
        "email": "jane_doe@example.com",
        "first_name": "Jane",
        "id": "asdf-Jkl-zxCvBNm",
        "last_name": "Doe",
        "list_ids": [],
        "segment_ids": [],
        "postal_code": "",
        "state_province_region": "",
        "phone_number": "",
        "whatsapp": "",
        "line": "",
        "facebook": "",
        "unique_name": "",
        "custom_fields": {},
        "created_at": "2021-03-02T15:25:47Z",
        "updated_at": "2021-03-30T15:26:16Z",
        "_metadata": {
          "self": "<metadata_url>"
        }
      }
    },
}

func (*MarketingController) POSTEmailSubscriber

func (m *MarketingController) POSTEmailSubscriber(w http.ResponseWriter, r *http.Request)

CreateUser godoc

@Summary	Create an user
@Schemes
@Description	create a user
@Tags			Users
@Accept			json
@Produce		json
@Success		200	{string}	Helloworld
@Router			/marketing/email [post]

type MarketingSubscribeDTO

type MarketingSubscribeDTO struct {
	Email string `json:"email" validate:"required,email"`
}

define custom type

type RecipientList

type RecipientList struct {
	Contacts []Contact `json:"contacts"`
}

Jump to

Keyboard shortcuts

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