Sanitize sets defaults to BulkMessage
()
| 56 | |
| 57 | // Sanitize sets defaults to BulkMessage |
| 58 | func (input *BulkMessage) Sanitize() *BulkMessage { |
| 59 | input.ToPhoneNumber = input.sanitizeAddress(input.ToPhoneNumber) |
| 60 | input.Content = strings.TrimSpace(input.Content) |
| 61 | input.FromPhoneNumber = input.sanitizeAddress(input.FromPhoneNumber) |
| 62 | |
| 63 | var attachments []string |
| 64 | for _, attachment := range strings.Split(input.AttachmentURLs, ",") { |
| 65 | if strings.TrimSpace(attachment) != "" { |
| 66 | attachments = append(attachments, strings.TrimSpace(attachment)) |
| 67 | } |
| 68 | } |
| 69 | input.AttachmentURLs = strings.Join(attachments, ",") |
| 70 | return input |
| 71 | } |
| 72 | |
| 73 | // ToMessageSendParams converts BulkMessage to services.MessageSendParams |
| 74 | func (input *BulkMessage) ToMessageSendParams(userID entities.UserID, requestID string, source string, index int, location *time.Location) services.MessageSendParams { |
nothing calls this directly
no test coverage detected