django-gsuite-email-0.1.2
توضیحات
Send emails via a GSuite Service-account.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | django-gsuite-email-0.1.2 |
| نام | django-gsuite-email |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | slicefox |
| ایمیل نویسنده | adithya.webdev@gmail.com |
| آدرس صفحه اصلی | https://github.com/slicefox/django-gsuite-email |
| آدرس اینترنتی | https://pypi.org/project/django-gsuite-email/ |
| مجوز | MIT |
# GSuite Email Backend
[](https://pepy.tech/project/django-gsuite-email)


[](https://django-gsuite-email.readthedocs.io/en/latest/?badge=latest)
This package allows to use Django's `send_mail` command to send emails through GSuite account.
It requires a serviceaccount credential created in Google coud console,
The crendential file need to have `https://www.googleapis.com/auth/gmail.send` scope.
Follow [this tutorial](https://developers.google.com/identity/protocols/oauth2/service-account#python) to create the credentials file, make sure to add `https://www.googleapis.com/auth/gmail.send` scope.
## Installation
```sh
pip install django-gsuite-email
```
# Quick start
#### 1. Add it to installed apps in `setings.py`
```python
INSTALLED_APPS = [
...
'django_gsuite_email',
...
]
```
#### 2. Set the Email EMAIL_BACKEND setting
```python
EMAIL_BACKEND = 'django_gsuite_email.GSuiteEmailBackend'
```
#### 3. Set location of credentials file.
To do this, either set `GSUITE_CREDENTIALS_FILE` environment variable.\
OR \
set `GSUITE_CREDENTIALS_FILE` in `settings.py`
````python
GSUITE_CREDENTIALS_FILE="/path/to/credentials/file.json"
````
> #### Note: `GSUITE_CREDENTIALS_FILE` in `settings.py` will take precedence over environment variable.
#### 4. Send emails
```python
from django.core.mail import send_mail
send_mail(
'Subject here',
'Here is the message.',
'from@example.com',
['to@example.com'],
fail_silently=False,
)
```
نیازمندی
| مقدار | نام |
|---|---|
| >=1.8.0 | google-api-python-client |
| >=1.11.3 | google-auth |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.0.0 | Python |
نحوه نصب
نصب پکیج whl django-gsuite-email-0.1.2:
pip install django-gsuite-email-0.1.2.whl
نصب پکیج tar.gz django-gsuite-email-0.1.2:
pip install django-gsuite-email-0.1.2.tar.gz