Skip to content

Conversation

mrashed-dev
Copy link
Contributor

Description

This PR adds support for sending raw MIME messages.

Usage

from nylas import APIClient
nylas = APIClient(
    CLIENT_ID,
    CLIENT_SECRET,
    ACCESS_TOKEN
)

raw_mime = """MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Subject: With Love, From Nylas
From: You <example@gmail.com>
To: My Nylas Friend <recipient@gmail.com>

This email was sent via raw MIME using the Nylas email API. Visit https://nylas.com for details.
"""

draft = nylas.drafts.create()

# Send the raw MIME
msg = draft.send_raw(raw_mime)

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@mrashed-dev mrashed-dev requested review from a team, pengfeiye and jaykim97 and removed request for a team December 4, 2022 23:32
@mrashed-dev mrashed-dev marked this pull request as draft December 4, 2022 23:41
@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #243 (e7e96b0) into main (a1e3a73) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #243      +/-   ##
==========================================
+ Coverage   95.99%   96.01%   +0.02%     
==========================================
  Files          14       15       +1     
  Lines        1648     1657       +9     
==========================================
+ Hits         1582     1591       +9     
  Misses         66       66              
Impacted Files Coverage Δ
nylas/client/client.py 96.13% <100.00%> (+0.02%) ⬆️
nylas/client/restful_models.py 97.12% <100.00%> (+0.01%) ⬆️
nylas/__init__.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mrashed-dev mrashed-dev marked this pull request as ready for review December 9, 2022 13:41
@mrashed-dev mrashed-dev requested review from theblueskies, a team, dantonpimentel and dominicj-nylas and removed request for pengfeiye, jaykim97 and a team December 9, 2022 13:41
Copy link

@dantonpimentel dantonpimentel left a comment

Choose a reason for hiding this comment

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

lgtm

@mrashed-dev mrashed-dev merged commit 27227be into main Dec 12, 2022
@mrashed-dev mrashed-dev deleted the TSDK-532-python-add-support-for-mime-messages branch December 12, 2022 15:33
@mrashed-dev mrashed-dev mentioned this pull request Dec 16, 2022
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.

2 participants