(Events)
Trigger email sending with events
- PostEventsSend - Send an event
Send events to trigger emails in Loops.
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
}
}
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. |
*operations.PostEventsSendResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.EventFailureResponse | 400 | application/json |
sdkerrors.SDKError | 4xx-5xx | / |