Giter Site home page Giter Site logo

gmail's Introduction

Gamil OMG Microservice

Open Microservice Guide Build Status codecov

An OMG service for Gmail, this service uses the gmail API and perform gmail operations.

Direct usage in Storyscript:

Note: use scope "https://mail.google.com/" for send, receive and labels operation while authorization and for "filter operations" use scope "https://www.googleapis.com/auth/gmail.settings.basic".

Authorization
gmail authorization scope:'https://mail.google.com/'
Access Token
gmail accessToken authorizationCode:'authorization code generated from URL of authorization'
Refresh Token
gmail refreshToken token:'{"access_token": "access token","token_type": "Bearer","refresh_token": "refresh token","expiry": "2019-10-04T15:57:07.922121141Z"}'
Send Mail
gmail sendMail accessToken:'access token' userId:'[email protected]' to:'["[email protected]",[email protected]]' subject:'mail subject' body:'mail body'
Create Label
gmail createLabel accessToken:'access token' userId:'[email protected]' name:'OMG Label' backgroundColor:'#fce8b3' textColor:'#d5ae49' labelListVisibility:'labelShow' messageListVisibility:'show' 
Delete Label:
gmail deleteLabel accessToken:'access token' userId:'[email protected]' labelId:'label Id'
Patch Label:
gmail patchLabel accessToken:'access token' userId:'[email protected]' labelId:'label Id' name:'OMG Label' backgroundColor:'#fce8b3' textColor:'#d5ae49' labelListVisibility:'labelShow' messageListVisibility:'show' 
List Label
gmail labelList accessToken:'access token' userId:'[email protected]' 
Create Filter
gmail createFilter accessToken:'access token' userId:'[email protected]'  addLabelId='Label Id' removeLabelId='Label Id' excludeChats=false from:'[email protected]' to:'[email protected]' subject:'Mail subject' hasAttachment=false negatedQuery:'Negated query for filter' query:'query for filter' size=1 sizeComparison:smaller 
Delete Filter
gmail deleteFilter accessToken:'access token' userId:'[email protected]' filterId:'filter Id'
List Filter
gmail filterList accessToken:'access token' userId:'[email protected]' 
Receive Mail
gmail subscribe receive mail userId:'email address' accessToken:'access token'

Curious to learn more?

โœจ๐Ÿฐโœจ

Usage with OMG CLI

Authorization
omg run authorization -a scope=<OPERATION_SCOPE> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Access Token
$ omg run accessToken -a authorizationCode=<AUTHORIZATION_CODE> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Refresh Token
$ omg run refreshToken -a token=<TOKEN_MAPPED_OBJECT> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Send Mail
$ omg run sendMail -a accessToken=<ACCESS_TOKEN> -a userId=<SENDER_EMAIL_ADDRESS> -a to=[LIST_OF_RECEIVER_EMAIL_ADDRESS] -a subject=<MAIL_SUBJECT> -a body=<MESSAGE_BODY> -a accessToken=<ACCESS_TOKEN> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Create Label
omg run createLabel -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -a name=<LABEL_NAME> -a backgroundColor=<Label_BACKGROUND_COLOR> -a textColor=<Label_TEXT_COLOR> -a labelListVisibility=<LABEL_LIST_VISIBILITY> -a messageListVisibility=<MESSAGE_LIST_VISIBILITY> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Delete Label:
omg run deleteLabel -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -a labelId=<LABEL_ID> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Patch Label:
omg run patchLabel -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -a labelId=<LABEL_ID> -a name=<LABEL_NAME> -a backgroundColor=<Label_BACKGROUND_COLOR> -a textColor=<Label_TEXT_COLOR> -a labelListVisibility=<LABEL_LIST_VISIBILITY> -a messageListVisibility=<MESSAGE_LIST_VISIBILITY> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
List Label
omg run labelList -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Create Filter
omg run createFilter -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -a addLabelId=<ADD_LABEL_ID> -a removeLabelId=<REMOVE_LABEL_ID> -a excludeChats=<EXCLUDE_CHATS> -a from=<SENDER_EMAIl_ADDRESS> -a to=<RECEIVER_EMAIL_ADDRESS> -a subject=<MAIL_SUBJECT> -a hasAttachment=<HAS_ATTACHMENT> -a negatedQuery=<NEGATED_QUERY> -a query=<QUERY> -a size=<SIZE_OF_MESSAGE> -a sizeComparison=<SIZE_COMPARISON> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Delete Filter
omg run deleteFilter -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -a filterId=<FILTER_ID> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
List Filter
omg run filterList -a accessToken=<ACCESS_TOKEN> -a userId=<EMAIL_ADDRESS> -e CREDENTIAL_JSON=<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>
Receive Mail
$ omg run subscribe receive mail -a userId=<EMAIL_ADDRESS> -a accessToken=<ACCESS_TOKEN> -e CREDENTIAL_JSON==<BASE64_DATA_OF_CREDENTIAL_JSON_FILE>

Note: the OMG CLI requires Docker to be installed.

License

MIT License.

gmail's People

Contributors

ht68rohit avatar stevepeak avatar

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.