mailinator

package module
v0.0.0-...-a1ff848 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 8 Imported by: 0

README

mailinator-go-client

Mailianator.com Go client.

Install

go get -u github.com/manybrain/mailinator-go-client

Usage

To start using the API you need to first create an account at mailinator.com.

Once you have an account you will need an API Token which you can generate in mailinator.com/v3/#/#team_settings_pane.

Then you can configure the library with:

import "github.com/manybrain/mailinator-go-client"

// Replace API_TOKEN with your real key
client := mailinator.NewMailinatorClient("API_TOKEN")

Examples

Domains methods:
  • Get AllDomains / Domain:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Get All Domains
      res, err := client.GetDomains()
    
      //Get Domain
      res, err := client.GetDomain(&GetDomainOptions{"yourDomainIdHere"})
      // ...
    
Rules methods:
  • Create / Delete Rule:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Create Rule
      rule := RuleToCreate{
      	Name:        "RuleName",
      	Priority:    15,
      	Description: "Description",
      	Conditions: []Condition{
      		Condition{
      			Operation: OperationType("PREFIX"),
      			ConditionData: ConditionData{
      				Field: "to",
      				Value: "raul",
      			},
      		},
      	},
      	Enabled: true,
      	Match:   MatchType("ANY"),
      	Actions: []ActionRule{
      		ActionRule{
      			Action: ActionType("WEBHOOK"),
      			ActionData: ActionData{
      				Url: "https://google.com",
      			},
      		},
      	},
      }
    
      res, err := client.CreateRule(&CreateRuleOptions{"yourDomainIdHere", rule})
    
      //Delete Rule
      res, err := client.DeleteRule(&DeleteRuleOptions{"yourDomainIdHere", "yourRuleIdHere"})
      // ...
    
  • Enable/Disable Rule:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Enable Rule
      res, err := client.EnableRule(&EnableRuleOptions{"yourDomainIdHere", "yourRuleIdHere"})
    
      //Disable Rule
      res, err := client.DisableRule(&DisableRuleOptions{"yourDomainIdHere", "yourRuleIdHere"})
    
  • Get All Rules / Rule:

    import "github.com/manybrain/mailinator-go-client"

	client := mailinator.NewMailinatorClient("yourApiTokenHere")

    //Get All Rules
    res, err := client.GetAllRules(&GetAllRulesOptions{"yourDomainIdHere"})
    
    //Get Rule
    res, err := client.GetRule(&GetRuleOptions{"yourDomainIdHere", "yourRuleIdHere"})
Messages methods:
  • Inject Message:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      message := MessageToPost{
      		Subject: "Testing message",
      		From:    "test_email@test.com",
      		Text:    "Hello World!",
      	}
      	res, err := client.PostMessage(&PostMessageOptions{"yourDomainNameHere", "yourInboxHere", message})
      // ...
    
  • Fetch Inbox / Message / SMS Messages / Attachments / Attachment:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Fetch Inbox
      res, err := client.FetchInbox(&FetchInboxOptions{Domain: "yourDomainNameHere", Inbox: "yourInboxHere"})
    
      //Fetch Message
      res, err := client.FetchInboxMessage(&FetchInboxMessageOptions{"yourDomainNameHere", "yourInboxHere", "yourMessageIdHere"})
    
      //Fetch SMS Messages
      res, err := client.FetchSMSMessage(&FetchSMSMessageOptions{"yourDomainNameHere", "yourTeamSMSNumberHere"})
    
      //Fetch Attachments
      res, err := client.FetchInboxMessageAtachments(&FetchInboxMessageAttachmentsOptions{"yourDomainNameHere", "yourInboxHere", "yourMessageIdWithAttachmentHere"})
    
      //Fetch Attachment
      res, err := client.FetchInboxMessageAttachment(&FetchInboxMessageAttachmentOptions{"yourDomainNameHere", "yourInboxHere", "yourMessageIdWithAttachmentHere", "yourAttachmentIdHere"})
    
      //Fetch Message Links
      res, err := client.FetchInboxMessageLinks(&FetchInboxMessageLinksOptions{"yourDomainNameHere", "yourInboxHere", "yourMessageIdHere"})
    
  • Delete Message / AllInboxMessages / AllDomainMessages

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Delete Message
      res, err := client.DeleteMessage(&DeleteMessageOptions{"yourDomainNameHere", "yourInboxHere", "yourMessageIdHere"})
    
      //Delete All Inbox Messages
      res, err := client.DeleteAllInboxMessages(&DeleteAllInboxMessagesOptions{"yourDomainNameHere", "yourInboxHere"})
    
      //Delete All Domain Messages
      res, err := client.DeleteAllDomainMessages(&DeleteAllDomainMessagesOptions{"yourDomainNameHere"})
    
Stats methods:
  • Get Team / Team Stats:

      import "github.com/manybrain/mailinator-go-client"
    
      client := mailinator.NewMailinatorClient("yourApiTokenHere")
    
      //Get Team
      res, err := client.GetTeamStats()
    
      //Get TeamStats
      res, err := client.GetTeam()
      // ...
    

Testing

Run integration tests with real API Key.

go test -v -tags=integration

Most of the tests require env variables with valid values. Visit tests source code and review integration_test.go file. The more env variables you set, the more tests are run.

  • MAILINATOR_TEST_API_TOKEN - API tokens for authentication; basic requirement across many tests;see also https://manybrain.github.io/m8rdocs/#api-authentication
  • MAILINATOR_TEST_DOMAIN_PRIVATE - private domain; visit https://www.mailinator.com/
  • MAILINATOR_TEST_INBOX - some already existing inbox within the private domain
  • MAILINATOR_TEST_PHONE_NUMBER - associated phone number within the private domain; see also https://manybrain.github.io/m8rdocs/#fetch-an-sms-messages
  • MAILINATOR_TEST_MESSAGE_WITH_ATTACHMENT_ID - existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
  • MAILINATOR_TEST_ATTACHMENT_ID - existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
  • MAILINATOR_TEST_DELETE_DOMAIN - don't use it unless you are 100% sure what you are doing
  • MAILINATOR_TEST_WEBHOOKTOKEN_PRIVATEDOMAIN - private domain for webhook token
  • MAILINATOR_TEST_WEBHOOKTOKEN_CUSTOMSERVICE - custom service for webhook token
  • MAILINATOR_TEST_AUTH_SECRET - authenticator secret
  • MAILINATOR_TEST_AUTH_ID - authenticator id
  • MAILINATOR_TEST_WEBHOOK_INBOX - inbox for webhook
  • MAILINATOR_TEST_WEBHOOK_CUSTOMSERVICE - custom service for webhook

Documentation

Index

Constants

View Source
const (
	ANY          MatchType = "ANY"
	ALL                    = "ALL"
	ALWAYS_MATCH           = "ALWAYS_MATCH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionData

type ActionData struct {
	Url string `json:"url"`
}

ActionData .

type ActionRule

type ActionRule struct {
	Action     ActionType `json:"action"`
	ActionData ActionData `json:"action_data"`
}

ActionRule .

type ActionType

type ActionType string

ActionType .

const (
	WEBHOOK ActionType = "WEBHOOK"
	DROP               = "DROP"
)

type Attachment

type Attachment struct {
	Filename                string `json:"filename"`
	ContentDisposition      string `json:"content-disposition"`
	ContentTransferEncoding string `json:"content-transfer-encoding"`
	ContentType             string `json:"content-type"`
	AttachmentId            int    `json:"attachment-id"`
}

Attachment .

type Attachments

type Attachments struct {
	Attachments []Attachment `json:"attachments"`
}

Attachments .

type Authenticator

type Authenticator struct {
	Id               string   `json:"id"`
	TimeStep         int      `json:"time_step"`
	FutureCodes      []string `json:"futurecodes"`
	NextResetSeconds int      `json:"next_reset_secs"`
	Passcode         string   `json:"passcode"`
}

Authenticator .

type Authenticators

type Authenticators struct {
	Passcodes []Authenticator `json:"passcodes"`
}

Authenticators .

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client .

func NewMailinatorClient

func NewMailinatorClient(apiToken string) *Client

NewMailinatorClient creates new Mailinator client with given API Token

func (*Client) CreateDomain

func (c *Client) CreateDomain(options *CreateDomainOptions) (*ResponseStatus, error)

This endpoint creates a private domain attached to your account. Note, the domain must be unique to the system and you must have not reached your maximum number of Private Domains .

func (*Client) CreateRule

func (c *Client) CreateRule(options *CreateRuleOptions) (*Rule, error)

Creates a Rule. Note that in the examples, ":domain_id" can be one of your private domains.

func (*Client) DeleteAllDomainMessages

func (c *Client) DeleteAllDomainMessages(options *DeleteAllDomainMessagesOptions) (*DeletedMessages, error)

Deletes ALL messages from a Private Domain. Caution: This action is irreversible.

func (*Client) DeleteAllInboxMessages

func (c *Client) DeleteAllInboxMessages(options *DeleteAllInboxMessagesOptions) (*DeletedMessages, error)

Deletes ALL messages from a specific private inbox.

func (*Client) DeleteDomain

func (c *Client) DeleteDomain(options *DeleteDomainOptions) (*ResponseStatus, error)

This endpoint deletes a Private Domain .

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(options *DeleteMessageOptions) (*DeletedMessages, error)

Deletes a specific messages

func (*Client) DeleteRule

func (c *Client) DeleteRule(options *DeleteRuleOptions) (*ResponseStatus, error)

Deletes a specific Rule from a Domain

func (*Client) DisableRule

func (c *Client) DisableRule(options *DisableRuleOptions) (*ResponseStatus, error)

Disable an existing Rule

func (*Client) EnableRule

func (c *Client) EnableRule(options *EnableRuleOptions) (*ResponseStatus, error)

Enable an existing Rule

func (*Client) FetchInbox

func (c *Client) FetchInbox(options *FetchInboxOptions) (*Inbox, error)

Retrieves a list of messages summaries. You can retreive a list by inbox, inboxes, or entire domain.

func (*Client) FetchInboxMessage

func (c *Client) FetchInboxMessage(options *FetchInboxMessageOptions) (*Message, error)

Retrieves a specific message by id for specific inbox.

func (*Client) FetchInboxMessageAtachments

func (c *Client) FetchInboxMessageAtachments(options *FetchInboxMessageAttachmentsOptions) (*Attachments, error)

Retrieves a list of attachments for a message for specific inbox. Note attachments are expected to be in Email format.

func (*Client) FetchInboxMessageAttachment

func (c *Client) FetchInboxMessageAttachment(options *FetchInboxMessageAttachmentOptions) (*FetchAttachmentResponse, error)

Retrieves a specific attachment for specific inbox .

func (c *Client) FetchInboxMessageLinks(options *FetchInboxMessageLinksOptions) (*MessageLinks, error)

Retrieves all links found within a given email for specific inbox .

func (*Client) FetchInboxMessageRaw

func (c *Client) FetchInboxMessageRaw(options *FetchInboxMessageRawOptions) (*string, error)

This endpoint retrieves raw info from the email for specific inbox .

func (*Client) FetchInboxMessageSmtpLog

func (c *Client) FetchInboxMessageSmtpLog(options *FetchInboxMessageSmtpLogOptions) (*MessageSmtpLogs, error)

This endpoint retrieves smtp log from the email for specific inbox .

func (*Client) FetchLatestInboxMessages

func (c *Client) FetchLatestInboxMessages(options *FetchLatestInboxMessagesOptions) (*Inbox, error)

That fetches the latest 5 FULL messages for specific inbox .

func (*Client) FetchLatestMessages

func (c *Client) FetchLatestMessages(options *FetchLatestMessagesOptions) (*Inbox, error)

That fetches the latest 5 FULL messages .

func (*Client) FetchMessage

func (c *Client) FetchMessage(options *FetchMessageOptions) (*Message, error)

Retrieves a specific message by id.

func (*Client) FetchMessageAtachments

func (c *Client) FetchMessageAtachments(options *FetchMessageAttachmentsOptions) (*Attachments, error)

Retrieves a list of attachments for a message. Note attachments are expected to be in Email format.

func (*Client) FetchMessageAttachment

func (c *Client) FetchMessageAttachment(options *FetchMessageAttachmentOptions) (*FetchAttachmentResponse, error)

Retrieves a specific attachment.

func (c *Client) FetchMessageLinks(options *FetchMessageLinksOptions) (*MessageLinks, error)

Retrieves all links found within a given email

func (*Client) FetchMessageRaw

func (c *Client) FetchMessageRaw(options *FetchMessageRawOptions) (*string, error)

This endpoint retrieves raw info from the email .

func (*Client) FetchMessageSmtpLog

func (c *Client) FetchMessageSmtpLog(options *FetchMessageSmtpLogOptions) (*MessageSmtpLogs, error)

This endpoint retrieves smtp log from the email .

func (*Client) FetchSMSMessage

func (c *Client) FetchSMSMessage(options *FetchSMSMessageOptions) (*SMSMessage, error)

Retrieves a specific SMS message by sms number.

func (*Client) GetAllRules

func (c *Client) GetAllRules(options *GetAllRulesOptions) (*Rules, error)

Fetches a All Rules for a Domain

func (*Client) GetAuthenticator

func (c *Client) GetAuthenticator() (*Authenticators, error)

Fetches Authenticator

func (*Client) GetAuthenticatorById

func (c *Client) GetAuthenticatorById(options *GetAuthenticatorsByIdOptions) (*Authenticator, error)

Fetches Authenticator By Id

func (*Client) GetAuthenticators

func (c *Client) GetAuthenticators() (*Authenticators, error)

Fetches Authenticators

func (*Client) GetAuthenticatorsById

func (c *Client) GetAuthenticatorsById(options *GetAuthenticatorsByIdOptions) (*Authenticator, error)

Fetch the TOTP 2FA code from one of your saved Keys

func (*Client) GetDomain

func (c *Client) GetDomain(options *GetDomainOptions) (*Domain, error)

Fetches a specific domain

func (*Client) GetDomains

func (c *Client) GetDomains() (*DomainsList, error)

Fetches a list of all your domains.

func (*Client) GetRule

func (c *Client) GetRule(options *GetRuleOptions) (*Rule, error)

Fetches a Rules for a Domain

func (*Client) GetTeam

func (c *Client) GetTeam() (*TeamInfo, error)

Retrieves team info

func (*Client) GetTeamStats

func (c *Client) GetTeamStats() (*TeamStats, error)

Retrieves stats of team

func (*Client) InstantTOTP2FACode

func (c *Client) InstantTOTP2FACode(options *InstantTOTP2FACodeOptions) (*InstantTOTP2FACode, error)

Instant TOTP 2FA code.

func (*Client) PostMessage

func (c *Client) PostMessage(options *PostMessageOptions) (*PostedMessage, error)

Deliver a JSON message into your private domain.

func (*Client) PrivateCustomServiceInboxWebhook

func (c *Client) PrivateCustomServiceInboxWebhook(options *PrivateCustomServiceInboxWebhookOptions) error

The SMS message will arrive in the Private Mailinator inbox corresponding to the Twilio Phone Number. (only the digits, if a plus sign precedes the number it will be removed) If you wish the message to arrive in a different inbox, you may append the destination inbox to the URL .

func (*Client) PrivateCustomServiceWebhook

func (c *Client) PrivateCustomServiceWebhook(options *PrivateCustomServiceWebhookOptions) error

If you have a Twilio account which receives incoming SMS messages. You may direct those messages through this facility to inject those messages into the Mailinator system . Mailinator intends to apply specific mappings for certain services that commonly publish webhooks . If you test incoming Messages to SMS numbers via Twilio, you may use this endpoint to correctly map "to", "from", and "subject" of those messages to the Mailinator system.By default, the destination inbox is the Twilio phone number .

func (*Client) PrivateInboxWebhook

func (c *Client) PrivateInboxWebhook(options *PrivateInboxWebhookOptions) (*ResponseStatusWithId, error)

This command will deliver the message to the :inbox inbox . Incoming Webhooks are delivered to Mailinator inboxes and from that point onward are not notably different than other messages in the system (i.e. emails) . As normal, Mailinator will list all messages in the Inbox page and via the Inbox API calls . If the incoming JSON payload does not contain a "from" or "subject", then dummy values will be inserted in these fields . You may retrieve such messages via the Web Interface, the API, or the Rule System .

func (*Client) PrivateWebhook

func (c *Client) PrivateWebhook(options *PrivateWebhookOptions) (*ResponseStatusWithId, error)

This command will Webhook messages into your Private Domain . The incoming Webhook will arrive in the inbox designated by the "to" field in the incoming request payload . Webhooks into your Private System do NOT use your regular API Token . This is because a typical use case is to enter the Webhook URL into 3rd-party systems(i.e.Twilio, Zapier, IFTTT, etc) and you should never give out your API Token . Check your Team Settings where you can create "Webhook Tokens" designed for this purpose .

func (*Client) PublicCustomServiceInboxWebhook

func (c *Client) PublicCustomServiceInboxWebhook(options *PublicCustomServiceInboxWebhookOptions) error

The SMS message will arrive in the Public Mailinator inbox corresponding to the Twilio Phone Number. (only the digits, if a plus sign precedes the number it will be removed) If you wish the message to arrive in a different inbox, you may append the destination inbox to the URL.

func (*Client) PublicCustomServiceWebhook

func (c *Client) PublicCustomServiceWebhook(options *PublicCustomServiceWebhookOptions) error

If you have a Twilio account which receives incoming SMS messages. You may direct those messages through this facility to inject those messages into the Mailinator system .

func (*Client) PublicInboxWebhook

func (c *Client) PublicInboxWebhook(options *PublicInboxWebhookOptions) (*ResponseStatusWithId, error)

This command will deliver the message to the :inbox inbox Note that if the Mailinator system cannot determine the destination inbox via the URL or a "to" field in the payload, the message will be rejected. If the message contains a "from" and "subject" field, these will be visible on the inbox page.

func (*Client) PublicWebhook

func (c *Client) PublicWebhook(options *PublicWebhookOptions) (*ResponseStatusWithId, error)

This command will deliver the message to the :to inbox that was set into request object.

type Condition

type Condition struct {
	Operation     OperationType `json:"operation"`
	ConditionData ConditionData `json:"condition_data"`
}

Condition .

type ConditionData

type ConditionData struct {
	Field string `json:"field"`
	Value string `json:"value"`
}

ConditionData .

type CreateDomainOptions

type CreateDomainOptions struct {
	Name string `json:"name"`
}

CreateDomainOptions .

type CreateRuleOptions

type CreateRuleOptions struct {
	DomainId     string       `json:"domain_id"`
	RuleToCreate RuleToCreate `json:"rule_to_create"`
}

CreateRuleOptions .

type DeleteAllDomainMessagesOptions

type DeleteAllDomainMessagesOptions struct {
	Domain string `json:"domain"`
}

DeleteAllDomainMessagesOptions .

type DeleteAllInboxMessagesOptions

type DeleteAllInboxMessagesOptions struct {
	Domain string `json:"domain"`
	Inbox  string `json:"inbox"`
}

DeleteAllInboxMessagesOptions .

type DeleteDomainOptions

type DeleteDomainOptions struct {
	DomainId string `json:"domain_id"`
}

DeleteDomainOptions .

type DeleteMessageOptions

type DeleteMessageOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

DeleteMessageOptions .

type DeleteRuleOptions

type DeleteRuleOptions struct {
	DomainId string `json:"domain_id"`
	RuleId   string `json:"rule_id"`
}

DeleteRuleOptions .

type DeletedMessages

type DeletedMessages struct {
	Status string `json:"status"`
	Count  int    `json:"count"`
}

DeletedMessages .

type DisableRuleOptions

type DisableRuleOptions struct {
	DomainId string `json:"domain_id"`
	RuleId   string `json:"rule_id"`
}

DisableRuleOptions .

type Domain

type Domain struct {
	Id          string `json:"_id"`
	Description string `json:"description"`
	Enabled     bool   `json:"enabled"`
	Name        string `json:"name"`
	Rules       []Rule `json:"rules"`
}

Domain .

type DomainsList

type DomainsList struct {
	Domains []Domain `json:"domains"`
}

DomainsList .

type EmailLogEntry

type EmailLogEntry struct {
	Log   string `json:"log"`
	Time  string `json:"time"`
	Event string `json:"event"`
}

EmailLogEntry .

type EnableRuleOptions

type EnableRuleOptions struct {
	DomainId string `json:"domain_id"`
	RuleId   string `json:"rule_id"`
}

EnableRuleOptions .

type FetchAttachmentResponse

type FetchAttachmentResponse struct {
	Bytes       []byte `json:"bytes"`
	ContentType string `json:"content-type"`
	FileName    string `json:"filename"`
}

FetchAttachmentResponse .

type FetchInboxMessageAttachmentOptions

type FetchInboxMessageAttachmentOptions struct {
	Domain       string `json:"domain"`
	Inbox        string `json:"inbox"`
	MessageId    string `json:"message_id"`
	AttachmentId int    `json:"attachment_id"`
}

FetchInboxMessageAttachmentOptions .

type FetchInboxMessageAttachmentsOptions

type FetchInboxMessageAttachmentsOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

FetchInboxMessageAttachmentsOptions .

type FetchInboxMessageLinksOptions

type FetchInboxMessageLinksOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

FetchInboxMessageLinksOptions .

type FetchInboxMessageOptions

type FetchInboxMessageOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

FetchInboxMessageOptions .

type FetchInboxMessageRawOptions

type FetchInboxMessageRawOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

FetchInboxMessageRawOptions .

type FetchInboxMessageSmtpLogOptions

type FetchInboxMessageSmtpLogOptions struct {
	Domain    string `json:"domain"`
	Inbox     string `json:"inbox"`
	MessageId string `json:"message_id"`
}

FetchInboxMessageSmtpLogOptions .

type FetchInboxOptions

type FetchInboxOptions struct {
	Domain        string `json:"domain"`
	Inbox         string `json:"inbox"`
	Skip          int    `json:"skip"`
	Limit         int    `json:"limit"`
	Sort          Sort   `json:"sort"`
	DecodeSubject bool   `json:"decode_subject"`
}

FetchInboxOptions .

type FetchLatestInboxMessagesOptions

type FetchLatestInboxMessagesOptions struct {
	Domain string `json:"domain"`
	Inbox  string `json:"inbox"`
}

FetchLatestInboxMessagesOptions .

type FetchLatestMessagesOptions

type FetchLatestMessagesOptions struct {
	Domain string `json:"domain"`
}

FetchLatestMessagesOptions .

type FetchMessageAttachmentOptions

type FetchMessageAttachmentOptions struct {
	Domain       string `json:"domain"`
	MessageId    string `json:"message_id"`
	AttachmentId int    `json:"attachment_id"`
}

FetchMessageAttachmentOptions .

type FetchMessageAttachmentsOptions

type FetchMessageAttachmentsOptions struct {
	Domain    string `json:"domain"`
	MessageId string `json:"message_id"`
}

FetchMessageAttachmentsOptions .

type FetchMessageLinksOptions

type FetchMessageLinksOptions struct {
	Domain    string `json:"domain"`
	MessageId string `json:"message_id"`
}

FetchMessageLinksOptions .

type FetchMessageOptions

type FetchMessageOptions struct {
	Domain    string `json:"domain"`
	MessageId string `json:"message_id"`
}

FetchMessageOptions .

type FetchMessageRawOptions

type FetchMessageRawOptions struct {
	Domain    string `json:"domain"`
	MessageId string `json:"message_id"`
}

FetchMessageRawOptions .

type FetchMessageSmtpLogOptions

type FetchMessageSmtpLogOptions struct {
	Domain    string `json:"domain"`
	MessageId string `json:"message_id"`
}

FetchMessageSmtpLogOptions .

type FetchSMSMessageOptions

type FetchSMSMessageOptions struct {
	Domain        string `json:"domain"`
	TeamSMSNumber string `json:"YOUR_TEAM_SMS_NUMBER"`
}

FetchSMSMessageOptions .

type GetAllRulesOptions

type GetAllRulesOptions struct {
	DomainId string `json:"domain_id"`
}

GetAllRulesOptions .

type GetAuthenticatorsByIdOptions

type GetAuthenticatorsByIdOptions struct {
	Id string `json:"id"`
}

GetAuthenticatorsByIdOptions .

type GetDomainOptions

type GetDomainOptions struct {
	DomainId string `json:"domain_id"`
}

GetDomainOptions .

type GetRuleOptions

type GetRuleOptions struct {
	DomainId string `json:"domain_id"`
	RuleId   string `json:"rule_id"`
}

GetRuleOptions .

type Inbox

type Inbox struct {
	Domain   string    `json:"domain"`
	To       string    `json:"to"`
	Messages []Message `json:"msgs"`
}

Inbox .

type InstantTOTP2FACode

type InstantTOTP2FACode struct {
	TimeStep         int      `json:"time_step"`
	FutureCodes      []string `json:"futurecodes"`
	NextResetSeconds int      `json:"next_reset_secs"`
	Passcode         string   `json:"passcode"`
}

InstantTOTP2FACode .

type InstantTOTP2FACodeOptions

type InstantTOTP2FACodeOptions struct {
	TotpSecretKey string `json:"totpSecretKey"`
}

InstantTOTP2FACodeOptions .

type MatchType

type MatchType string

MatchType .

type Member

type Member struct {
	Role  string `json:"role"`
	Id    string `json:"_id"`
	Email string `json:"email"`
}

Member .

type Message

type Message struct {
	Subject    string  `json:"subject"`
	From       string  `json:"from"`
	To         string  `json:"to"`
	Id         string  `json:"id"`
	Time       float64 `json:"time"`
	SecondsAgo float64 `json:"seconds_ago"`
	Domain     string  `json:"domain"`

	IsFirstExchange bool                   `json:"is_first_exchange"`
	Fromfull        string                 `json:"fromfull"`
	Headers         map[string]interface{} `json:"headers"`
	Parts           []Part                 `json:"parts"`
	Origfrom        string                 `json:"origfrom"`
	Mrid            string                 `json:"mrid"`
	Size            int                    `json:"size"`
	Stream          string                 `json:"stream"`
	MsgType         string                 `json:"msg_type"`
	Source          string                 `json:"source"`
	Text            string                 `json:"text"`
}

Message .

type MessageLinks struct {
	Links []string `json:"links"`
}

MessageLinks .

type MessageRaw

type MessageRaw struct {
	RawData string `json:"rawData"`
}

MessageRaw .

type MessageSmtpLogs

type MessageSmtpLogs struct {
	LogEntries []EmailLogEntry `json:"log"`
}

MessageSmtpLogs .

type MessageToPost

type MessageToPost struct {
	Subject string `json:"subject"`
	From    string `json:"from"`
	Text    string `json:"text"`
}

MessageToPost .

type OperationType

type OperationType string

OperationType .

const (
	EQUALS OperationType = "EQUALS"
	PREFIX               = "PREFIX"
)

type Part

type Part struct {
	Headers map[string]string `json:"headers"`
	Body    string            `json:"body"`
}

Part .

type PlanData

type PlanData struct {
	StorageMb              int `json:"storage_mb"`
	NumberOfPrivateDomains int `json:"num_private_domains"`
	EmailReadsPerDay       int `json:"email_reads_per_day"`
	TeamAccounts           int `json:"team_accounts"`
}

PlanData .

type PostMessageOptions

type PostMessageOptions struct {
	Domain  string        `json:"domain"`
	Inbox   string        `json:"inbox"`
	Message MessageToPost `json:"message_to_post"`
}

PostMessageOptions .

type PostedMessage

type PostedMessage struct {
	Status     string `json:"status"`
	Id         string `json:"id"`
	RulesFired []Rule `json:"rules_fired"`
}

PostedMessage .

type PrivateCustomServiceInboxWebhookOptions

type PrivateCustomServiceInboxWebhookOptions struct {
	WebhookToken  string  `json:"wh-token"`
	Webhook       Webhook `json:"webhook"`
	Inbox         string  `json:"inbox"`
	CustomService string  `json:"customService"`
}

PrivateCustomServiceInboxWebhookOptions .

type PrivateCustomServiceWebhookOptions

type PrivateCustomServiceWebhookOptions struct {
	WebhookToken  string  `json:"wh-token"`
	Webhook       Webhook `json:"webhook"`
	CustomService string  `json:"customService"`
}

PrivateCustomServiceWebhookOptions .

type PrivateDomain

type PrivateDomain struct {
	PD      string `json:"pd"`
	Enabled bool   `json:"enabled"`
}

PrivateDomain .

type PrivateInboxWebhookOptions

type PrivateInboxWebhookOptions struct {
	WebhookToken string  `json:"wh-token"`
	Webhook      Webhook `json:"webhook"`
	Inbox        string  `json:"inbox"`
}

PrivateInboxWebhookOptions .

type PrivateWebhookOptions

type PrivateWebhookOptions struct {
	WebhookToken string  `json:"wh-token"`
	Webhook      Webhook `json:"webhook"`
}

PrivateWebhookOptions .

type PublicCustomServiceInboxWebhookOptions

type PublicCustomServiceInboxWebhookOptions struct {
	Webhook       Webhook `json:"webhook"`
	Inbox         string  `json:"inbox"`
	CustomService string  `json:"customService"`
}

PublicCustomServiceInboxWebhookOptions .

type PublicCustomServiceWebhookOptions

type PublicCustomServiceWebhookOptions struct {
	Webhook       Webhook `json:"webhook"`
	CustomService string  `json:"customService"`
}

PublicCustomServiceWebhookOptions .

type PublicInboxWebhookOptions

type PublicInboxWebhookOptions struct {
	Webhook Webhook `json:"webhook"`
	Inbox   string  `json:"inbox"`
}

PublicInboxWebhookOptions .

type PublicWebhookOptions

type PublicWebhookOptions struct {
	Webhook Webhook `json:"webhook"`
}

PublicWebhookOptions .

type ResponseStatus

type ResponseStatus struct {
	Status string `json:"status"`
}

ResponseStatus .

type ResponseStatusWithId

type ResponseStatusWithId struct {
	Id     string `json:"id"`
	Status string `json:"status"`
}

ResponseStatusWithId .

type Retrieved

type Retrieved struct {
	WebPublic  int `json:"web_public"`
	ApiError   int `json:"api_error"`
	WebPrivate int `json:"web_private"`
	ApiEmail   int `json:"api_email"`
}

Retrieved .

type Rule

type Rule struct {
	Id          string       `json:"_id"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Enabled     bool         `json:"enabled"`
	Match       MatchType    `json:"match_type"`
	Priority    int          `json:"priority"`
	Conditions  []Condition  `json:"conditions"`
	Actions     []ActionRule `json:"actions"`
}

Rule .

type RuleToCreate

type RuleToCreate struct {
	Description string       `json:"description"`
	Enabled     bool         `json:"enabled"`
	Match       MatchType    `json:"match"`
	Name        string       `json:"name"`
	Priority    int          `json:"priority"`
	Conditions  []Condition  `json:"conditions"`
	Actions     []ActionRule `json:"actions"`
}

RuleToCreate .

type Rules

type Rules struct {
	Rules []Rule `json:"rules"`
}

Rules .

type SMSMessage

type SMSMessage struct {
	Domain   string    `json:"domain"`
	To       string    `json:"to"`
	Messages []Message `json:"msgs"`
}

SMSMessage .

type SMSNumber

type SMSNumber struct {
	Number  string `json:"number"`
	Country string `json:"country"`
	Status  string `json:"status"`
}

SMSNumber .

type Sent

type Sent struct {
	SMS   int `json:"sms"`
	Email int `json:"email"`
}

Sent .

type Sort

type Sort string

Sort .

type Stat

type Stat struct {
	Date      string    `json:"date"`
	Retrieved Retrieved `json:"retrieved"`
	Sent      Sent      `json:"sent"`
}

Stat .

type TeamInfo

type TeamInfo struct {
	PrivateDomains []PrivateDomain `json:"private_domains"`
	SMSNumbers     []SMSNumber     `json:"sms_number"`
	Members        []Member        `json:"members"`
	PlanData       PlanData        `json:"plan_data"`
	Id             string          `json:"_id"`
	Plan           string          `json:"plan"`
	TeamName       string          `json:"team_name"`
	Token          string          `json:"token"`
	Status         string          `json:"status"`
}

TeamInfo .

type TeamStats

type TeamStats struct {
	Stats []Stat `json:"stats"`
}

TeamStats .

type Webhook

type Webhook struct {
	From    string `json:"from"`
	Subject string `json:"subject"`
	Text    string `json:"text"`
	To      string `json:"to"`
}

Webhook .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL