Skip to content
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

Update to latest Carbon. Added support for attachments. #18

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

jwoertink
Copy link
Member

Ref #13

Now that Carbon has some support for attachments I need to update this shard so we can do a release. I followed the SMTP update for attachment and used the Sendgrid docs https://docs.sendgrid.com/api-reference/mail-send/mail-send to mimic the structure.

@@ -35,7 +36,6 @@ class Carbon::SendGridAdapter < Carbon::Adapter
end

# :nodoc:
# Used only for testing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this said used only for testing 🤔 This method is how we send the email lol

@@ -1,6 +1,7 @@
require "http"
require "json"
require "carbon"
require "base64"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sendgrid API docs mention that attachments should be Base64.

files = [] of Hash(String, String)
email.attachments.map do |attachment|
case attachment
in AttachFile, ResourceFile
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the difference between AttachFile and ResourceFile are, but I'm guessing it's related to SMTP and doesn't really matter in this case.

@jwoertink jwoertink merged commit e364b4f into main Apr 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant