-
Notifications
You must be signed in to change notification settings - Fork 166
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
Improve Resend documentation and checks #293
Improve Resend documentation and checks #293
Conversation
ea5fa98
to
88e17ea
Compare
from django.core.mail import EmailMessage | ||
|
||
message.reply( | ||
EmailMessage(subject="pong", body="pongpong") |
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.
I had to also add the to field so that the email was actually sent.
from django.core import mail
def reply_to_message(message, subject, messagebody):
rpl = mail.EmailMessage(
subject=subject,
body=messagebody,
to=[message.from_header],
)
message.reply(rpl)
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.
Though it might be worth adding that to the reply
method?
if not to:
add to from reply_to or from_header
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.
Interesting!
Is it something to document or should we expect the "reply" function to set it automatically...
WDYT @Pietro395 ?
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.
Interesting! Is it something to document or should we expect the "reply" function to set it automatically... WDYT @Pietro395 ?
Interesting observation @enaut
In my opinion since you are using the reply function I would expect the “to” to be set automatically if not specified.
I think that's what a user would expect
After 2 issues related to the usage of the
reply()
function, it wasn't clear what is the type ofmessage
variable.ValueError('Message must be an instance of django.core.mail.EmailMessage')