Skip to content

Add check_credentials method to PostmarkEmailSender#4

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/add-check-postmark-informations
Closed

Add check_credentials method to PostmarkEmailSender#4
Copilot wants to merge 4 commits intomainfrom
copilot/add-check-postmark-informations

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Adds validation utility for Postmark SMTP credentials used in test suite.

Changes

  • PostmarkEmailSender.check_credentials(test_connection=True): Returns dict with credential status (api_token_set, sender_email_set, credentials_set) and optional SMTP connection validation (connection_valid, error)
  • Tests: Added test_check_credentials_without_connection_test and test_check_credentials_with_connection_test
  • Documentation: Fixed POSTMARK_API_KEYPOSTMARK_API_TOKEN env var name; added usage examples

Usage

from tests.email_sender import PostmarkEmailSender

sender = PostmarkEmailSender()

# Check credentials without testing connection
result = sender.check_credentials(test_connection=False)
# {'credentials_set': True, 'api_token_set': True, 'sender_email_set': True, 
#  'connection_valid': None, 'error': None}

# Validate credentials with SMTP connection test
result = sender.check_credentials(test_connection=True)
if result['connection_valid']:
    print("Credentials valid")
else:
    print(f"Failed: {result['error']}")

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • smtp.postmarkapp.com
    • Triggering command: `/usr/bin/python3 python3 -c
      from tests.email_sender import PostmarkEmailSender

sender = PostmarkEmailSender()

Test without connection

result = sender.check_credentials(test_connection=False)
print('Without connection test:', result)

Test with connection

result = sender.check l` (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Crwate a new action to check if the postmark informations are set and usable


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add action to check postmark informations are set and usable Add check_credentials method to PostmarkEmailSender Jan 15, 2026
Copilot AI requested a review from sokripon January 15, 2026 22:56
@sokripon sokripon closed this Jan 15, 2026
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