Adds logic to manage suppressions#214
Open
gavin-truework wants to merge 3 commits intoStranger6667:masterfrom
Open
Adds logic to manage suppressions#214gavin-truework wants to merge 3 commits intoStranger6667:masterfrom
gavin-truework wants to merge 3 commits intoStranger6667:masterfrom
Conversation
- Adds calls to list, add, and delete suppression support - Adds doc pages
Stranger6667
requested changes
Jun 20, 2023
Owner
Stranger6667
left a comment
There was a problem hiding this comment.
Hm, I need some time to check the testing side here, I didn't touch the repo in a while, not sure if my test account is still active
docs/supression.rst
Outdated
| To view the current suppression list: | ||
| .. code-block:: python | ||
|
|
||
| >>> response = postmark.get_suppressions(stream_id="test") |
Owner
There was a problem hiding this comment.
I think it would be better to unify suppressions with other sub-sections, so it is postmark.suppressions.all(stream_id="test")
Author
There was a problem hiding this comment.
Gotcha, I think I switched over to a sub-section.
docs/supression.rst
Outdated
| >>> print(response['Suppressions']) | ||
| { | ||
| "Suppressions":[ | ||
| { |
Owner
There was a problem hiding this comment.
It might be useful to return a list of some light-weight object instead of a dict with Suppressions inside
src/postmarker/core.py
Outdated
| data = {'Suppressions': []} | ||
| for email in emails: | ||
| data['Suppressions'].append({'EmailAddress': email}) | ||
| response = self._call("POST", url, "", data) |
Owner
There was a problem hiding this comment.
I'd suggest using self.root_api_url instead for root and endpoint separately
- Add a suppression and suppression_response object to handle responses from the API - Updates _call calls to use endpoints - Dedupes code - Update docs to reflect new returns
Z33DD
approved these changes
Feb 29, 2024
Contributor
|
@Stranger6667 Check this later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to open this to add some basic support for managing suppressions in Postmark. This just adds a few methods to manage them based on the provided API.
I am not 100% sure how I should test this. Do you have a testing account setup that the test should attempt to list, add, and remove a suppression to? I also am not super familiar with docs, so please let me know if I need to do something else.