Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sinch Support #185

Merged
merged 1 commit into from
Jan 15, 2020
Merged

Sinch Support #185

merged 1 commit into from
Jan 15, 2020

Conversation

caronc
Copy link
Owner

@caronc caronc commented Dec 9, 2019

Description:

Sinch is a lot like Twilio which made it's adaptation pretty quick into Apprise. However, unlike Twilio, it doesn't offer any free services that I'm aware of.

Account Setup

To use Sinch, you will need to acquire your Service Plan ID and API Token. Both of these are accessible via the Sinch Dashboard or through the API section.

You'll need to have a number defined as an Active Number (from your dashboard here). This will become your {FromPhoneNo} when identifying the details below.

Syntax

Valid syntaxes are as follows:

  • sinch://{ServicePlanID}:{ApiToken}@{FromPhoneNo}/{PhoneNo}
  • sinch://{ServicePlanID}:{ApiToken}@{FromPhoneNo}/{PhoneNo1}/{PhoneNo2}/{PhoneNoN}

If no ToPhoneNo is specified, then the FromPhoneNo will be messaged instead; hence the following is a valid URL:

  • sinch://{ServicePlanID}:{ApiToken}@{FromPhoneNo}/

Short Codes are also supported but require at least 1 Target PhoneNo

  • sinch://{ServicePlanID}:{ApiToken}@{ShortCode}/{PhoneNo}
  • sinch://{ServicePlanID}:{ApiToken}@{ShortCode}/{PhoneNo1}/{PhoneNo2}/{PhoneNoN}

Parameter Breakdown

Variable Required Description
ServicePlanID Yes The Account SID associated with your Sinch account. This is available to you via the Sinch Dashboard.
ApiToken Yes The Auth Token associated with your Sinch account. This is available to you via the Sinch Dashboard.
FromPhoneNo *No The Active Phone Number associated with your Sinch account you wish the SMS message to come from. It must be a number registered with Sinch. As an alternative to the FromPhoneNo, you may also provide a ShortCode here instead. The phone number MUST include the country codes dialling prefix as well when placed. This field is also very friendly and supports brackets, spaces and hyphens in the event you want to format the number in an easy to read fashion.
ShortCode *No The ShortCode associated with your Sinch account you wish the SMS message to come from. It must be a number registered with Sinch. As an alternative to the ShortCode, you may provide a FromPhoneNo instead.
PhoneNo *No A phone number MUST include the country codes dialling prefix as well when placed. This field is also very friendly and supports brackets, spaces and hyphens in the event you want to format the number in an easy to read fashion.
Note: If you're using a ShortCode, then at least one PhoneNo MUST be defined.
Region No Can be either us or eu. By default the region is set to us.

New Service Completion Status

  • apprise/plugins/NotifySinch.py
  • setup.py
    • add new service into the keywords section of the setup() declaration
  • README.md
    • add entry for new service to table (as a quick reference)
  • packaging/redhat/python-apprise.spec
    • add new service into the %global common_description

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

@codecov-io
Copy link

codecov-io commented Dec 9, 2019

Codecov Report

Merging #185 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #185    +/-   ##
======================================
  Coverage     100%   100%            
======================================
  Files          71     72     +1     
  Lines        8479   8614   +135     
  Branches     1372   1394    +22     
======================================
+ Hits         8479   8614   +135
Impacted Files Coverage Δ
apprise/plugins/NotifySinch.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4aee9de...51d89b7. Read the comment docs.

@caronc caronc added the blocked Blocked due to missing information and/or an issue outside of this project. label Dec 22, 2019
@caronc
Copy link
Owner Author

caronc commented Dec 22, 2019

At this time I am unable to test this as I don't have a phone number with Sinch to test with. I have reached out to them via email for assistance. Once confirmed this works, PR will be merged.

@caronc caronc merged commit 2e6a996 into master Jan 15, 2020
@caronc caronc removed the blocked Blocked due to missing information and/or an issue outside of this project. label Jan 15, 2020
@caronc caronc deleted the sinch-support branch January 17, 2020 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants