Skip to content

Microservice django-project for sw-python-email-devino library.

License

Notifications You must be signed in to change notification settings

telminov/email-service

Repository files navigation

email-service

Microservice django-project for sw-python-email-devino library.

Example send bulk

Service authentication

Session authentication or token authentication (http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication)

Add sender address in Devino.

After adding the sender's address, you need to contact the Devino manager to confirm the address

import requests
data = {
    'address': '[email protected]'
}
requests.post('http://127.0.0.1:8000/api/add_address_sender/', json=data, headers={'Authorization': 'Token ...'})

Get exists addresses

import requests
response = requests.get('http://127.0.0.1:8000/api/get_addresses_sender/',
                        headers={'Authorization': 'Token ...'})
response.json()
{'code': 'ok',
 'description': 'ok',
 'result': [{'Confirmed': True, 'SenderAddress': '[email protected]'}]}

Send one message to email

import requests

data = {
    'recipient_email': '[email protected]',
    'recipient_name': 'Test name',
    'sender_email': '[email protected]', 
    'sender_name': 'Other test name', 
    'subject': 'Test subj', 
    'text': 'Test text', 
}

response = requests.post('http://127.0.0.1:8000/api/send_message/', json=data, headers={'Authorization': 'Token ...'})
response.json()

Send message to exists contacts

import requests

data = {
    'name': 'Test name',
    'sender_email': '[email protected]',
    'sender_name': 'Other test name',
    'subject': 'Test subj',
    'text': 'Test text',
    'start': '07/15/2100 16:00',
    'contact_list': [[559446, True]],   # id contact group and boolean value include or not include a group in the bulk
}

requests.post('http://127.0.0.1:8000/api/add_task/', json=data, headers={'Authorization': 'Token ...'})

About

Microservice django-project for sw-python-email-devino library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published