elasticemail / elasticemail.webapiclient-python Goto Github PK
View Code? Open in Web Editor NEWEasily send emails with Elastic Email using Web API Python Client https://elasticemail.com/
License: MIT License
Easily send emails with Elastic Email using Web API Python Client https://elasticemail.com/
License: MIT License
When a post request is made using the current ElasticEmailClient.py file, it sends data as the url parameter. In the link given in the "Python Api Integration Library" article, the data is sent with the data parameter in the ElasticEmailClient.py file.
(Article: https://elasticemail.com/api-documentation/integration-libraries/introduction-to-our-python-api-integration-library)
(ElasticEmailClient.py link: http://api.elasticemail.com/public/client/python)
(photo: Comparison of ElasticEmailClient.py file in Github and Article)
I've tried to send email using the bodyHtml parameter. While sending the mail using ElasticEmailClient.py file in Github, i got this error:
By debugging, The result field in the Request method in the ApiClient class in the ElasticEmailClient.py file.
The problem is that it sends the data as a url parameter. The file in the article has resolved the problem. The file ElasticEmailClient.py, which is given as a link in the article, must also be added here.
Using current version of ElasticEmailWebApiClient on PyPI, it seems like merge tags are not getting translated to the correct format required by the V2 API. I confirmed this locally and I have some sample code that exhibits this behavior.
Setup Steps
pip install ElasticEmailWebApiClient==1.0.5
import os
from ElasticEmailClient import ApiClient, Email
ApiClient.apiKey = os.getenv('ELASTIC_EMAIL_API_KEY')
template_id = '58095'
to_email = '[email protected]'
inviter_email = '[email protected]'
invite_url = 'https://www.google.com'
Email.Send(to=[to_email],
template=template_id,
merge={'merge_inviter': inviter_email, 'merge_invite_url': invite_url},
isTransactional=True)
Email sends, but does NOT replace merge variables.
Email sends, but replaces merge variables.
It appears that other ElasticEmail libraries for other languages specifically break out "merge" and it put in the correct URL parameters. See your PHP library for example
It actually looks like this repository has a call to fix this, but this function is missing in the published version on PyPI. See this line in ElasticEmailClient.py and compare that with the code you download from PyPI for ElasticEmailWebApiClient
Also it actually looks like the repository is out of sync from PyPI. Can you please submit the latest version for this library to PyPI?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.