Git Product home page Git Product logo

mailersend-python's People

Contributors

fosron avatar igorhrcek avatar joaofscruz avatar marcelkooi avatar nklmilojevic avatar renovate-bot avatar renovate[bot] avatar robgordon89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mailersend-python's Issues

Add attachment content disposition

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
On email and bulk email endpoint setup

attachments.*.disposition
attachments.*.id

Describe alternatives you've considered
None

Additional context
None

Get bulk email status doesn't work

A customer found a bug in our Python SDK:
Send in Bulk: https://github.com/mailersend/mailersend-python#send-bulk-email
Get bulk email status: https://github.com/mailersend/mailersend-python#get-bulk-email-status

from mailersend import emails
mailer = mailersend.NewEmail(api_key)

That doesn’t work because NewEmail is not a class from “mailersend” but from “emails”.
The correct should be:

from mailersend import emails
mailer = emails.NewEmail(api_key)

Reported by Cesar here.

Image

Add the priority parameter to the inbound route endpoints

We have a new parameter called "inbound_priority" on our Inbound Routes. This parameter allows our users to create multiple inbound routes per inbound subdomain. Each one of the routes will be processed in a descending order. Values can be between 0 and 100. 0 has more importance than 100.

get_activity_by_date does not return any data

Describe the bug
get_activity_by_date method in Analytics class does not return any data

To Reproduce
Steps to reproduce the behavior:

  1. Create a new py file with the following code:
from mailersend import analytics
 
api_key = "xxxx"
 
 
mailer = analytics.NewAnalytics(api_key)
 
date_from = 1655382659
date_to = 1655641859
events = [
    "processed",
    "sent",
]
 
# optional arguments
group_by = "days"
 
x = mailer.get_activity_by_date(date_from, date_to, events)
print(x)
  1. Run the code
  2. See the error:
{"message":"The given data was invalid.","errors":{"date_from":["The date from field is required."],"date_to":["The date to field is required."],"event":["The event must be an array."]}}

Expected behavior
Function should return a JSON with appropriate data

Screenshots
None

Environment (please complete the following information):

  • OS: any
  • Python version: any
  • SDK version: any

Additional context
None

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/publish.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • JRubics/poetry-publish v1.17
pep621
pyproject.toml
  • poetry >=0.12
poetry
pyproject.toml
  • python ^3.7
  • requests ^2.25.0
  • setuptools ^68.0.0
  • pytest ^7.0
  • twine ^4.0.1
  • pre-commit ^2.12.1

  • Check this box to trigger a request for Renovate to run again on this repository

get_domain_activity method is sending incorrect data

Describe the bug
get_domain_activity method in the Activity class is sending dateFrom and dateTo instead of start_date and end_date.

To Reproduce
Steps to reproduce the behaviour:

  1. Check MailerSend API documentation and compare it with code implementation

Expected behaviour
We should be using start_date and end_date

Screenshots
None

Environment (please complete the following information):
None
Additional context
None

Missing information on docs? camelCase?

Hi there, I was wondering if the documentation for the package usage is accurate. I've the class receives the api_key, but it is no mentioned in the docs. Also, I'm curious on what were the reasons to use camelCase in a Python package. Coming from sendgrid, if things workout ok I could also contribute.

Edit: sorry, I missed the os.environ.get("MAILERSEND_API_KEY"). Would it make sense to make it so that the api_key is a parameter, instead of necessarily having to use the env_var?

Allow passing payload for domain add

Is your feature request related to a problem? Please describe.
While adding a domain, only the name is allowed to pass. MailerSend's other language library as allowed to pass parameters in addition to the name such as custom_tracking_subdomain etc.

Describe the solution you'd like
Allow all four parameters mentioned here while adding a domain.

Describe alternatives you've considered
One alternate I have considered is adding a domain and then updating those settings with the individual calls, but that will result in 4 calls to achieve this.

suddenly my code that was working has stopped working

The bug/issue
Related to get_domain_activity, error is that i don't provide date_to and date_from even though i do provide them as you can see in the code below

To Reproduce
Steps to reproduce the behavior:

mailer = activity.NewActivity(api_key)
end_date = datetime.datetime.now()
start_date = end_date - datetime.timedelta(days=1)
#end_date=end_date.isoformat()
#start_date=start_date.isoformat()
end_date = int(end_date.timestamp())
start_date = int(start_date.timestamp())
events = [
"delivered",
]

sent_emails=mailer.get_domain_activity("my domain",limit=100,date_from=start_date, date_to=end_date, event=events)

sent_emails=json.loads(str(sent_emails))

Expected behavior
I have the list.

Environment (please complete the following information):

  • Python version 3.10
  • SDK version 0.5.1

Update the list of all webhook events

Please update the list of all webhook events in the documentation or any place where they are mentioned:
SOFT_BOUNCED = "activity.soft_bounced",
HARD_BOUNCED = "activity.hard_bounced",
OPENED = "activity.opened",
OPENED_UNIQUE = "activity.opened_unique",
CLICKED = "activity.clicked",
CLICKED_UNIQUE = "activity.clicked_unique",
UNSUBSCRIBED = "activity.unsubscribed",
SPAM_COMPLIANT = "activity.spam_complaint",
SURVEY_OPENED = "activity.survey_opened",
SURVEY_SUBMITTED = "activity.survey_submitted",
IDENTITY_VERIFIED = "sender_identity.verified",
MAINTENANCE_START = "maintenance.start",
MAINTENANCE_END = "maintenance.end",

Add missing parameters to Domains endpoints

We added two parameters for our domains: ignore duplicated recipients and add a precedence bulk header. Both of these parameters have to be added to our related Domains endpoints.

  • Add the ignore_duplicated_recipients and the precedence_bulk parameters to the Get a list of domains endpoint.
  • Add the ignore_duplicated_recipients and the precedence_bulk parameters to the Get a single domain endpoint.
  • Add the ignore_duplicated_recipients and the precedence_bulk parameters to the Add a domain endpoint.
  • Add the ignore_duplicated_recipients and the precedence_bulk parameters to the Update domain settings endpoint.

Suggest to add token as .env variable instead of explicit declaration

As to better enforce security on our SDKs and avoid incidents, please avoid suggesting our users to set explicit declaration of the API/SMTP token in the code and instead suggest setting the API key as an environment variable.

  • Remove the "Explicit declaration" section from the Authentication title. Rephrase section if need be.
  • Suggest users to add the token as a .env variable. Name the variable MAILERSEND_API_KEY.
  • Make it optional.

your example not working

neither

`from mailersend import emails

mailer = emails.NewEmail()
mailer.mailersend_api_key = 'eyJ0eXAiOiJKV1QiLCJ....xWbVag'

mail_body = {}

mail_from = {
"name": "Your Name",
"email": "[email protected]",
}

recipients = [
{
"name": "Your Client",
"email": "[email protected]",
}
]

mailer.set_mail_from(mail_from, mail_body)
mailer.set_mail_to(recipients, mail_body)
mailer.set_subject("Hello!", mail_body)
mailer.set_html_content("This is the HTML content", mail_body)
mailer.set_plaintext_content("This is the text content", mail_body)

print(mailer.send(mail_body))`

nor this

`from mailersend import emails
import os

os.environ['MAILERSEND_API_KEY'] = 'eyJ0eXAiOiJKV1QiLC...WbVag'

mailer = emails.NewEmail()

mail_body = {}

mail_from = {
"name": "Your Name",
"email": "[email protected]",
}

recipients = [
{
"name": "Your Client",
"email": "[email protected]",
}
]

mailer.set_mail_from(mail_from, mail_body)
mailer.set_mail_to(recipients, mail_body)
mailer.set_subject("Hello!", mail_body)
mailer.set_html_content("This is the HTML content", mail_body)
mailer.set_plaintext_content("This is the text content", mail_body)

print(mailer.send(mail_body))`

is working:
401 {"message":"Unauthenticated."}

The API-Key is OK, it works with Postman.

What´s wrong?

PyPI Version Bump

Hello,

Is there anyway you could push the version on PyPI to include the "send template" functionality?

Thanks!

Package is not installable via pip

  • pip install mailersend gives
ERROR: Could not find a version that satisfies the requirement mailersend (from versions: none)
ERROR: No matching distribution found for mailersend
  • python version: 3.7.8
  • pip version: 21.1.2

Create the Email verification endpoints

  • Get all email verification lists
  • Get an email verification list
  • Create an email verification list
  • Verify an email list
  • Get email verification list results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.