(TransactionalEmails)
Send transactional emails
- PostTransactional - Send a transactional email
Send a transactional email to a contact.
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
}
}
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. |
*operations.PostTransactionalResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.PostTransactionalResponseBody | 400 | application/json |
sdkerrors.TransactionalFailure2Response | 404 | application/json |
sdkerrors.SDKError | 4xx-5xx | / |