All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| EmailsByMsgidViewGet | Get /emails/{msgid}/view | View Email |
| EmailsByTransactionidStatusGet | Get /emails/{transactionid}/status | Get Status |
| EmailsMergefilePost | Post /emails/mergefile | Send Bulk Emails CSV |
| EmailsPost | Post /emails | Send Bulk Emails |
| EmailsTransactionalPost | Post /emails/transactional | Send Transactional Email |
EmailData EmailsByMsgidViewGet(ctx, msgid).Execute()
View Email
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
msgid := "msgid_example" // string | Message identifier
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EmailsAPI.EmailsByMsgidViewGet(context.Background(), msgid).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EmailsAPI.EmailsByMsgidViewGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EmailsByMsgidViewGet`: EmailData
fmt.Fprintf(os.Stdout, "Response from `EmailsAPI.EmailsByMsgidViewGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| msgid | string | Message identifier |
Other parameters are passed through a pointer to a apiEmailsByMsgidViewGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EmailJobStatus EmailsByTransactionidStatusGet(ctx, transactionid).ShowFailed(showFailed).ShowSent(showSent).ShowDelivered(showDelivered).ShowPending(showPending).ShowOpened(showOpened).ShowClicked(showClicked).ShowAbuse(showAbuse).ShowUnsubscribed(showUnsubscribed).ShowErrors(showErrors).ShowMessageIDs(showMessageIDs).Execute()
Get Status
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
transactionid := "transactionid_example" // string | Transaction identifier
showFailed := true // bool | Include Bounced email addresses. (optional) (default to false)
showSent := true // bool | Include Sent email addresses. (optional) (default to false)
showDelivered := true // bool | Include all delivered email addresses. (optional) (default to false)
showPending := true // bool | Include Ready to send email addresses. (optional) (default to false)
showOpened := true // bool | Include Opened email addresses. (optional) (default to false)
showClicked := true // bool | Include Clicked email addresses. (optional) (default to false)
showAbuse := true // bool | Include Reported as abuse email addresses. (optional) (default to false)
showUnsubscribed := true // bool | Include Unsubscribed email addresses. (optional) (default to false)
showErrors := true // bool | Include error messages for bounced emails. (optional) (default to false)
showMessageIDs := true // bool | Include all MessageIDs for this transaction (optional) (default to false)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EmailsAPI.EmailsByTransactionidStatusGet(context.Background(), transactionid).ShowFailed(showFailed).ShowSent(showSent).ShowDelivered(showDelivered).ShowPending(showPending).ShowOpened(showOpened).ShowClicked(showClicked).ShowAbuse(showAbuse).ShowUnsubscribed(showUnsubscribed).ShowErrors(showErrors).ShowMessageIDs(showMessageIDs).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EmailsAPI.EmailsByTransactionidStatusGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EmailsByTransactionidStatusGet`: EmailJobStatus
fmt.Fprintf(os.Stdout, "Response from `EmailsAPI.EmailsByTransactionidStatusGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| transactionid | string | Transaction identifier |
Other parameters are passed through a pointer to a apiEmailsByTransactionidStatusGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
showFailed | bool | Include Bounced email addresses. | [default to false] showSent | bool | Include Sent email addresses. | [default to false] showDelivered | bool | Include all delivered email addresses. | [default to false] showPending | bool | Include Ready to send email addresses. | [default to false] showOpened | bool | Include Opened email addresses. | [default to false] showClicked | bool | Include Clicked email addresses. | [default to false] showAbuse | bool | Include Reported as abuse email addresses. | [default to false] showUnsubscribed | bool | Include Unsubscribed email addresses. | [default to false] showErrors | bool | Include error messages for bounced emails. | [default to false] showMessageIDs | bool | Include all MessageIDs for this transaction | [default to false]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EmailSend EmailsMergefilePost(ctx).MergeEmailPayload(mergeEmailPayload).Execute()
Send Bulk Emails CSV
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
mergeEmailPayload := *openapiclient.NewMergeEmailPayload(*openapiclient.NewMessageAttachment(string(123), "Name_example"), *openapiclient.NewEmailContent("John Doe <email@domain.com>")) // MergeEmailPayload | Email data
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EmailsAPI.EmailsMergefilePost(context.Background()).MergeEmailPayload(mergeEmailPayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EmailsAPI.EmailsMergefilePost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EmailsMergefilePost`: EmailSend
fmt.Fprintf(os.Stdout, "Response from `EmailsAPI.EmailsMergefilePost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiEmailsMergefilePostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| mergeEmailPayload | MergeEmailPayload | Email data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EmailSend EmailsPost(ctx).EmailMessageData(emailMessageData).Execute()
Send Bulk Emails
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
emailMessageData := *openapiclient.NewEmailMessageData([]openapiclient.EmailRecipient{*openapiclient.NewEmailRecipient("mail@example.com")}, *openapiclient.NewEmailContent("John Doe <email@domain.com>")) // EmailMessageData | Email data
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EmailsAPI.EmailsPost(context.Background()).EmailMessageData(emailMessageData).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EmailsAPI.EmailsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EmailsPost`: EmailSend
fmt.Fprintf(os.Stdout, "Response from `EmailsAPI.EmailsPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiEmailsPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| emailMessageData | EmailMessageData | Email data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EmailSend EmailsTransactionalPost(ctx).EmailTransactionalMessageData(emailTransactionalMessageData).Execute()
Send Transactional Email
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
emailTransactionalMessageData := *openapiclient.NewEmailTransactionalMessageData(*openapiclient.NewTransactionalRecipient([]string{"To_example"}), *openapiclient.NewEmailContent("John Doe <email@domain.com>")) // EmailTransactionalMessageData | Email data
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EmailsAPI.EmailsTransactionalPost(context.Background()).EmailTransactionalMessageData(emailTransactionalMessageData).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EmailsAPI.EmailsTransactionalPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EmailsTransactionalPost`: EmailSend
fmt.Fprintf(os.Stdout, "Response from `EmailsAPI.EmailsTransactionalPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiEmailsTransactionalPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| emailTransactionalMessageData | EmailTransactionalMessageData | Email data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]