slicefox / django-gsuite-email

A email backend for django for sending emails with gsuite service account
MIT License
12 stars 5 forks source link

Support display name in email From field #6

Open yutotakano opened 7 months ago

yutotakano commented 7 months ago

Heya, thanks for the library! Just want to report a feature request.

The current implementation uses the from_email field of a send_mail call and uses it both for the email 'From' field and the GSuite impersonation subject.

Unfortunately this means that if we try to set a display name for the From field, like No Reply <noreply@domain.com>, we get an Invalid Impersonation error.

I think what should be done is that that the email's display name should be kept for the 'From' field but removed for the GSuite subject, or somehow supply a different field.

yutotakano commented 7 months ago

I believe sanitizing the field to get only the actual email (as mentioned in line 41's comment) would solve it. Maybe #5 might as well?

amorilla commented 7 months ago

Added new setting for this in #5

amorilla commented 7 months ago

I've created djau-gsuite-email for test

pip install djau-gsuite-email
slicefox commented 5 months ago

I have made a rc release, do check this out with pip install django_gsuite_email==0.2.0rc1

v0.2.0 will have this

3 is also closed, all thanks to @amorilla!