-
Notifications
You must be signed in to change notification settings - Fork 9
Attachment support #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| - body: Custom email body (plain text). | ||
| */ | ||
| public class func configure(to recipients: [String], subject: String?, body: String? = nil) { | ||
| public class func configure(to recipients: [String], subject: String?, body: String? = nil, attachments: (() -> [MailAttachment])? = nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 143 characters (line_length)
|
|
||
| let attachment = BugShaker.MailAttachment(data: try! Data(contentsOf: file), mimeType: "text/plain", fileName: fileName) | ||
|
|
||
| BugShaker.configure(to: [ "example@email.com" ], subject: "Bug Report", body: "Hi Developers, I am reporting a bug where...", attachments: [attachment]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 156 characters (line_length)
|
|
||
| try! fileContent.write(to: file, atomically: true, encoding: .utf8) | ||
|
|
||
| let attachment = BugShaker.MailAttachment(data: try! Data(contentsOf: file), mimeType: "text/plain", fileName: fileName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force Try Violation: Force tries should be avoided. (force_try)
Line Length Violation: Line should be 120 characters or less: currently 124 characters (line_length)
| let fileContent = "This is the content of the file." | ||
| let file = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0].appendingPathComponent(fileName) | ||
|
|
||
| try! fileContent.write(to: file, atomically: true, encoding: .utf8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force Try Violation: Force tries should be avoided. (force_try)
Add the ability to attach files (e. g. log files) to the message.