Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 2.69 KB

README.md

File metadata and controls

64 lines (47 loc) · 2.69 KB

Events

(Events)

Overview

Trigger email sending with events

Available Operations

PostEventsSend

Send events to trigger emails in Loops.

Example Usage

package main

import(
	loopsgo "github.com/speakeasy-sdks/loops-go"
	"github.com/speakeasy-sdks/loops-go/models/components"
	"context"
	"log"
)

func main() {
    s := loopsgo.New(
        loopsgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
    )
    request := components.EventRequest{
        EventName: "<value>",
        MailingLists: &components.EventRequestMailingLists{},
    }
    ctx := context.Background()
    res, err := s.Events.PostEventsSend(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.EventSuccessResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request components.EventRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.PostEventsSendResponse, error

Error Object Status Code Content Type
sdkerrors.EventFailureResponse 400 application/json
sdkerrors.SDKError 4xx-5xx /