(s string)
| 106 | bcc := parseAddresses(c.bcc) |
| 107 | if len(to)+len(cc)+len(bcc) == 0 { |
| 108 | return output.ErrUsage("a message needs at least one recipient (to, cc or bcc)") |
| 109 | } |
| 110 | messageWithAttachments, attachErr := attachFiles(ctx, message, c.attachments) |
| 111 | if attachErr != nil { |
| 112 | return attachErr |
| 113 | } |
| 114 | if err := sdk.Messages().Create(ctx, c.subject, messageWithAttachments, to, cc, bcc); err != nil { |
| 115 | return convertSDKError(err) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | summary := sentWithAttachmentsSummary("Message sent", len(c.attachments)) |
| 120 | if writer.IsStyled() { |
| 121 | fmt.Fprintln(cmd.OutOrStdout(), summary+".") |
| 122 | return nil |
| 123 | } |
no outgoing calls