Code Monkey home page Code Monkey logo

Comments (3)

 avatar commented on June 13, 2024

Hi,
We didn't saw that OpenAPI Generator made breaking change to Python generator and released breaking change in our library. Now we have switched to python-prior generator to not make such a breaking change without prior notification.

from elasticemail-python.

KalvinThien avatar KalvinThien commented on June 13, 2024

I have the same error:

File "./sendmail_elasticemail\ElasticEmail\api\emails_api.py", line 15, in
from ElasticEmail.api_client import ApiClient, Endpoint as _Endpoint
ImportError: cannot import name 'Endpoint' from 'ElasticEmail.api_client' (d:\SENDMAIL_PYTHON\sendmail_elasticemail\ElasticEmail\api_client.py)

import ElasticEmail
from ElasticEmail.api import emails_api
from ElasticEmail.model.email_content import EmailContent
from ElasticEmail.model.body_part import BodyPart
from ElasticEmail.model.body_content_type import BodyContentType
from ElasticEmail.model.email_recipient import EmailRecipient
from ElasticEmail.model.email_message_data import EmailMessageData
from pprint import pprint

Defining the host is optional and defaults to https://api.elasticemail.com/v4

configuration = ElasticEmail.Configuration()

Configure API key authorization: apikey

configuration.api_key['apikey'] = 'YOUR_API_KEY'

"""
Send bulk emails
Example api call that sends bulk merge email.
"""
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = emails_api.EmailsApi(api_client)
email_message_data = EmailMessageData(
recipients=[
EmailRecipient(
email="[email protected]",
fields={
"name": "John",
},
),
],
content=EmailContent(
body=[
BodyPart(
content_type=BodyContentType("HTML"),
content="Hi {name}!",
charset="utf-8",
),
BodyPart(
content_type=BodyContentType("PlainText"),
content="Hi {name}!",
charset="utf-8",
),
],
_from="[email protected]",
reply_to="[email protected]",
subject="Example email",
),
) # EmailMessageData | Email data

try:
    # Send Bulk Emails
    api_response = api_instance.emails_post(email_message_data)
    pprint(api_response)
except ElasticEmail.ApiException as e:
    print("Exception when calling EmailsApi->emails_post: %s\n" % e)

from elasticemail-python.

webcode2 avatar webcode2 commented on June 13, 2024

Any solution to this problem? having same issue here

from elasticemail-python.

Related Issues (4)

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.