Closed tylerneu closed 2 years ago
Thanks for reporting! I'll take a look and see if there's an easy way to implement this functionality
Would something like this work? https://github.com/sklarsa/django-sendgrid-v5/commit/19e09b392d08cee5f60d8de7c6dd20bf2813b2f4 This allows you to set a .method
on a MIMEBase
object that gets appended to the content type...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think so. We're working around this with the following.
class MIMECalendarRequest(MIMEText):
"""
A child of MIMEText to override get_content_type to ensure a "method" Content-Type param is included since
email.message.get_content_type() does not consider addition params.
"""
def get_content_type(self):
return f'{super().get_content_type()}; method=REQUEST'
Nice! Let's get this into v1.1
On Tue, Jun 22, 2021 at 4:40 PM Tyler Neu @.***> wrote:
I think so. We're working around this with the following.
class MIMECalendarRequest(MIMEText): """ A child of MIMEText to override get_content_type to ensure a "method" Content-Type param is included since email.message.get_content_type() does not consider addition params. """ def get_content_type(self): return f'{super().get_content_type()}; method=REQUEST'
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sklarsa/django-sendgrid-v5/issues/86#issuecomment-866317921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOXCRO3CA3RA4M2IODOUY3TUDYKTANCNFSM442Q5VJQ .
This slipped from 1.1 to 1.2.. will address once I have some time
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
A
method
Content-Type
parameter, like intext/calendar; method=REQUEST;
, is now an accepted parameter by the SendGrid API to support email clients displaying calendar invite RSVP controls but it is excluded during my use with this package.Examples of SendGrid announcing
method=REQUEST
is now supported. I was not able to find reference in their release notes.This script creates and sends a message with an attachment that has the
method
parameter using SendGrid's libraries.Creating a
MIMEBase
message and using this library will not include themethod
parameter.In my case, I see that
django_attch.get_content_type()
in_create_sg_attachment()
is only going to return themaintype/subtype
and not any additional parameters.