-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only attach the attachments when there's attachments to attach. (#21)
* Only attach the attachments when there's attachments to attach. Fixes #20 * Fixing compilation error. Ensure we can build the email without attachments
- Loading branch information
Showing
4 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class FakeEmailWithAttachments < Carbon::Email | ||
getter text_body, html_body | ||
|
||
def initialize( | ||
@from = Carbon::Address.new("[email protected]"), | ||
@to = [] of Carbon::Address, | ||
@cc = [] of Carbon::Address, | ||
@bcc = [] of Carbon::Address, | ||
@headers = {} of String => String, | ||
@subject = "subject", | ||
@text_body : String? = nil, | ||
@html_body : String? = nil | ||
) | ||
end | ||
|
||
from @from | ||
to @to | ||
cc @cc | ||
bcc @bcc | ||
subject @subject | ||
attachment contract | ||
|
||
def contract | ||
{ | ||
io: IO::Memory.new("Sign here"), | ||
file_name: "contract.pdf", | ||
mime_type: "application/pdf", | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters