Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmailCmd = &cobra.Command{ Use: "email <mailbox-resource-id>", Short: "Send email", Long: "Send a message from the managed mailbox. The message is accepted for delivery and dispatched within a few seconds; a copy is saved to INBOX.Sent once it is sent. A delivery failure after acceptance is not reported on this call.\n\nJSON flags take inline JSON, @file.json, or - to read stdin. Example values:\n\n --attachments\n [\n {\n \"cid\": \"logo\",\n \"content\": \"JVBERi0xLjQK...\",\n \"contentType\": \"application/pdf\",\n \"encoding\": \"base64\",\n \"filename\": \"invoice.pdf\"\n }\n ]\n\n --forwardof\n {\n \"folder\": \"INBOX\",\n \"uid\": 123\n }\n\n --inreplyto\n {\n \"folder\": \"INBOX\",\n \"uid\": 123\n }", Example: " hostinger-mail send email my-mailbox-resource-id", ValidArgsFunction: cobra.NoFileCompletions, RunE: func(cmd *cobra.Command, args []string) error { args = utils.PromptedArgs(cmd, args) body, err := emailBody(cmd) if err != nil { return err } payload, err := json.Marshal(body) if err != nil { return err } call := func(ctx context.Context) ([]byte, int, error) { r, err := api.Request().SendEmailWithBodyWithResponse(ctx, args[0], "application/json", bytes.NewReader(payload)) if err != nil { return nil, 0, err } return r.Body, r.StatusCode(), nil } respBody, status, err := call(cmd.Context()) if err != nil { return err } return output.Format(cmd, respBody, status) }, }
View Source
var GroupCmd = &cobra.Command{ Use: "send", Short: "Send commands", Args: cobra.ArbitraryArgs, RunE: utils.GroupRunE, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.