Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 3.3 KB

README.md

File metadata and controls

65 lines (48 loc) · 3.3 KB

TransactionalEmails

(TransactionalEmails)

Overview

Send transactional emails

Available Operations

PostTransactional

Send a transactional email to a contact.

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.TransactionalRequest{
        Email: "[email protected]",
        TransactionalID: "<value>",
    }
    ctx := context.Background()
    res, err := s.TransactionalEmails.PostTransactional(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.TransactionalSuccessResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.PostTransactionalResponse, error

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