Giter Site home page Giter Site logo

mailin-api-python's Introduction

SendinBlue Python API

This is the SendinBlue python API wrapper. You will need to install the following module

  • httplib2

Quickstart

  1. You will need to first get the Access key and Secret key from SendinBlue.

  2. Assuming that you have cloned this git repo, or downloaded mailin.py . You can use this small sample script to get started

from mailin import Mailin
m = Mailin("https://api.sendinblue.com/v1.0","access key","secret key")
campaigns = m.get_campaigns('')
  1. To explore more, you should visit the SendinBlue API documentation.

Available functions

Campaign calls

  • get_account() - Get your account information
  • get_campaigns(type) - Get list of all campaigns or of specific type: "classic", "trigger", "sms"
  • get_campaign(id) - Get specific campaign object
  • create_campaign(category,from_name,name,bat_sent,html_content,html_url,listid,scheduled_date,subject,from_email,reply_to,to_field,exclude_list) - Create a campaign
  • delete_campaign(id) - Delete a campaign
  • update_campaign(id,category,from_name,name,bat_sent,html_content,html_url,listid,scheduled_date,subject,from_email,reply_to,to_field,exclude_list) - Update campaign information
  • campaign_report_email(id,lang,email_subject,email_to,email_content_type,email_bcc,email_cc,email_body) - Sending reports to specific emails
  • campaign_recipients_export(id,notify_url,type) - Export recipients of a campaign
  • send_bat_email($campid,$email_to) - Send a test Email (bat)
  • create_trigger_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring) - Create a trigger campaign
  • update_trigger_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring) - Update trigger campaign information
  • get_folders() - Get list of all the folder details.
  • get_folder(id) - Get all the folder details for folder with id
  • create_folder(name) - Create a folder
  • delete_folder(id) - Delete folder with folder id
  • update_folder(id,name) - Update folder with folder id
  • get_lists() - Get all the lists
  • get_list(id) - Get information about a list
  • create_list(list_name,list_parent) - Create a list
  • delete_list(id) - Delete a list
  • update_list(id,list_name,list_parent) - Updating a list
  • add_users_list(id,users) - Add users to a list
  • delete_users_list(id,users) - Delete users from a list
  • get_attributes() - Listing all attributes
  • get_attribute(type) - Listing a certain type attributes
  • create_attribute(type,data) - Creating attributes
  • delete_attribute(type,data) - Deleting attributes
  • get_user(id) - Get information about a user/email
  • create_user(attributes,blacklisted,email,listid) - Add a new user/email
  • delete_user(id) - Deleting user from db is not permitted but this action will unlink him from all lists
  • update_user(id,attributes,blacklisted,listid,listid_unlink) - Edit a user/email information
  • import_users(url,listids,notify_url,name) - Import users/emails
  • export_users(export_attrib,filter,notify_url) - Export users/emails
  • get_processes() - Get information about all background processes
  • get_process(id) - Get information about a specific process

SMTP calls

  • get_report(limit,start_date,end_date,offset,date,days,email) - Retrieve information for all report events
  • get_statistics(aggregate,tag,days,end_date,start_date) - Get aggregate statistics about emails sent
  • get_webhooks() - List registered webhooks
  • get_webhook(id) - Get information about a webhook
  • create_webhook(url,description,events) - Registering a webhook
  • delete_webhook(id) - Deleting a webhook
  • update_webhook(id,url,description,events) - Editing a webhook
  • delete_bounces(start_date,end_date,email) - Deleting bounces
  • send_email(to,subject,from_name,html,text,cc,bcc,replyto,attachment,headers) - Sending out a transactional email
  • send_transactional_template(id,to,cc,bcc,attr) - Send templates created on mailin, through mailin smtp.
  • create_template($from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status) - Create a template
  • update_template($id,$from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status) - Update template information

SMS calls

  • send_sms(to,from_name,text,web_url,tag) - Sending a SMS
  • create_sms_campaign($camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Create a SMS campaign
  • update_sms_campaign($id,$camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Update a SMS campaign
  • send_bat_sms($campid,$mobilephone) - Send a test SMS campaign

Install

To install the mailin module you can run python setup.py install in the root of the distribution.

Dependencies

To just install the dependencies run pip install -r requirements.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.