Skip to content

Adds Clickatell support#1347

Merged
caronc merged 7 commits intocaronc:masterfrom
thmasker:master
Jun 12, 2025
Merged

Adds Clickatell support#1347
caronc merged 7 commits intocaronc:masterfrom
thmasker:master

Conversation

@thmasker
Copy link
Contributor

@thmasker thmasker commented Jun 2, 2025

Description:

Related issue (if applicable): #1340

This PR adds support for Clickatell. I need help with tests because I don't fully understand them

New Service Completion Status

  • apprise/plugins/clickatell.py
  • KEYWORDS
    • add new service into this file (alphabetically).
  • 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

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@<this.branch-name>

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  clickatell://ApiKey/ToPhoneNo

@codecov
Copy link

codecov bot commented Jun 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.38%. Comparing base (70cb7d8) to head (b35586e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1347   +/-   ##
=======================================
  Coverage   99.37%   99.38%           
=======================================
  Files         161      162    +1     
  Lines       21069    21159   +90     
  Branches     3791     3804   +13     
=======================================
+ Hits        20938    21028   +90     
  Misses        121      121           
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caronc
Copy link
Owner

caronc commented Jun 7, 2025

This is really great; i made some subtle changes to help assist you to get this merged.

  1. added full test coverage (you had a good start)
  2. filled in some missing functions you didn't have (__len__() and url_identifier())
  3. fixed url() to properly generate a valid re-usable Apprise URL

I also updated your URL suport a bit. It appears the from= is not mandatory? So the URLs changed to:

  • clickatell://apikey/targets
  • clickatell://from_phone@apikey/targets

this makes it a bit easier to parse the URL. Please do a git pull in your own branch to sync up with my changes and verify everything still works for you. If it does, I can go ahead and merge.

Great work! 🚀

@thmasker
Copy link
Contributor Author

thmasker commented Jun 9, 2025

Thanks for your help! I'd say the changes work, but I've found out a problem which I probably overlooked in the first place. Introducing several targets does not work because Clickatell only supports one target per call. It does not expect a list of to. I'll try to find a workaround for that (maybe the best solution is simply disable the multiple targets option in apprise service). What do you think?

@caronc
Copy link
Owner

caronc commented Jun 10, 2025

Not an issue at all, this is solved all throughout Apprise. You just need to update the send() to run through a while loop instead. See the ntfy example.

Lots of other examples too. You're very close at this point to being able to support multiple targets

@caronc
Copy link
Owner

caronc commented Jun 10, 2025

Some subtle additional change made:

  • use params= instead of building URL yourself on the fly.
  • if a target can't be notified, move on to the next (don't fail early)
  • Initializing title_maxlen = 0 in your class object looks after taking a title (if one was provided) and concatinating the body after it for you. No need to do this yourself. This is used by all SMS messages
  • Rest of changes look fine... let me know if this still works for you and we can do the merge!

Edit: Above changes were pushed, so you just need to sync up git pull

@thmasker
Copy link
Contributor Author

Just tested. It works perfectly fine. Thank you very much!

@caronc caronc merged commit cf12873 into caronc:master Jun 12, 2025
13 checks passed
@caronc
Copy link
Owner

caronc commented Jun 12, 2025

Merged! 🚀

@thmasker thmasker mentioned this pull request Jun 12, 2025
@thmasker
Copy link
Contributor Author

Hi, and no rush! Just wondering about releasing phase... When should I expect a new release? How often are releases done? Thanks!

@caronc
Copy link
Owner

caronc commented Jun 18, 2025

I apologize, I'm very slow releasing these days as I like to wait until I have accumulated enough new changes to warrant one. I travel a lot for my work, so this also compounds on the slow release cycles... The code base doesn't build in size as fast as it would in the past.

Let's let the code base sit for at least one more month. I'd like to get a few more lingering PRs merged. I'm hopeful that the ones I've actioned for others can be tested like you did for yours.

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