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

Added SendPulse Support #1192

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Added SendPulse Support #1192

wants to merge 5 commits into from

Conversation

caronc
Copy link
Owner

@caronc caronc commented Aug 28, 2024

Description:

Related issue (if applicable): #1137

SendPulse Notifications

  • Source: https://sendpulse.com/
  • Icon Support: no
  • Attachment Support: yes
  • Message Format: Text
  • Message Limit: 32768 Characters per message

Account Setup

Once you have an account and access to your dashboard. You will need to ensure you acquire your Client ID and Client Secret in order to construct the Apprise URLs

Syntax

Valid syntaxes are as follows:

  • {schema}://{user}@{host}/{client_id}/{client_secret}
  • {schema}://{user}@{host}/{client_id}/{client_secret}/{to_email}
  • {schema}://{user}@{host}/{client_id}/{client_secret}/{to_email1}/{to_email2}/{to_email3}

Template support is also supported as well, You just need to specify the integer assigned to it as part of the URL:

  • {schema}://{user}@{host}/{client_id}/{client_secret}/:{to_email}?template={temlate_int}

If you want to take advantage of the dynamic_template_data variables, just create arguments prefixed with a plus (+); for example:

  • sendpulse://{user}@{host}/{client_id}/{client_secret}/{to_email}?template={template_int}&+{sub1}=value&+{sub2}=value2

Parameter Breakdown

Variable Required Description
user Yes Combined with the host, it constructs the email address you have configured with your SendPulse account.
host Yes Combined with the user, it constructs the email address you have configured with your SendPulse account.
client_id Yes The Client ID associated with your SendPulse account.
client_secret Yes The Client Secret associated with your SendPulse account.
from No You can optionally identify who the email is from if you wish.
to_email No This is the email address will identify the email's destination (the To address). If one isn't specified then the from_email is used instead.
template No You may optionally specify the integer of a previously generated SendPulse template to base the email on.
cc No The Carbon Copy (CC:) portion of the email. This is entirely optional.
bcc No The Blind Carbon Copy (BCC:) portion of the email.

Dynamic Template Data

Apprise has template support for SendPulse. Just define the ?template= and the optional arguments you want to set. You can identify and set these variables using Apprise by simply sticking a plus (+) in front of any parameter you specify on your URL string.

Consider the following template: 1234

An Apprise URL might look like:

sendpulse://[email protected]?template=1234&+what=templates&+app=Apprise

Example

Send a SendPulse notification:

# Assuming our {user} is [email protected]
# Assuming our {client_id} is client_id
# Assuming our {client_secret} is client_secret
# Assuming we want to send an email to [email protected]
# Assuming our {to_email} is [email protected]
apprise -vv -t "Test Message Title" -b "Test Message Body" \
   sendpulse:///[email protected]/client_id/client_secret/[email protected]

New Service Completion Status

  • apprise/plugins/sendpulse.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@1137-sendpulse-support

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  "sendpulse://from@email/client_id/client_secret"

Copy link

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.36%. Comparing base (e3e34c4) to head (d5c6c4a).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1192    +/-   ##
========================================
  Coverage   99.35%   99.36%            
========================================
  Files         147      148     +1     
  Lines       20320    20590   +270     
  Branches     3979     4045    +66     
========================================
+ Hits        20189    20459   +270     
  Misses        121      121            
  Partials       10       10            

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

@caronc caronc linked an issue Sep 14, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request for supporting sendpulse SMTP
1 participant