Skip to content

Conversation

@abao168899
Copy link

@abao168899 abao168899 commented Feb 15, 2025

Update PySMS.py, README.md, and PySMS3.py to improve functionality and documentation.

  • PySMS.py

    • Remove the carriers dictionary and import the CARRIERS dictionary from constants.py.
    • Update the add_number method to use the CARRIERS dictionary from constants.py.
  • README.md

    • Add instructions for using the PySMS3 class for sending SMS via email using Python 3.
  • PySMS3.py

    • Add error handling for the init_smtp method.
    • Add a method for sending text messages with a callback function.

For more details, open the Copilot Workspace session.

Update `PySMS.py`, `README.md`, and `PySMS3.py` to improve functionality and documentation.

* **PySMS.py**
  - Remove the `carriers` dictionary and import the `CARRIERS` dictionary from `constants.py`.
  - Update the `add_number` method to use the `CARRIERS` dictionary from `constants.py`.

* **README.md**
  - Add instructions for using the `PySMS3` class for sending SMS via email using Python 3.

* **PySMS3.py**
  - Add error handling for the `init_smtp` method.
  - Add a method for sending text messages with a callback function.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/clayshieh/PySMS?shareId=XXXX-XXXX-XXXX-XXXX).
…with a callback function

* Add example code for sending a text message with a callback function
* Add a callback function example that prints the message sent to the address
@abao168899
Copy link
Author

This pull request includes several changes to the PySMS and PySMS3 modules, as well as updates to the README.md file. The changes enhance the functionality of the modules and improve error handling. Below are the most important changes:

PySMS Module Enhancements:

  • Refactored carrier definitions by moving them to a new constants module, improving code organization. [1] [2]
  • Added import statement for the new constants module.

PySMS3 Module Enhancements:

  • Improved error handling in the init_smtp method by adding a try-except block to catch smtplib.SMTPException errors.
  • Added a new method send_text_message_with_callback to send text messages with a callback function, enhancing functionality.
  • Updated imports to include Callable from the typing module.

Documentation Updates:

  • Added a new section to the README.md file with instructions for using the PySMS3 class for sending SMS via email using Python 3.

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.

1 participant