Comments (1)
Hey @ratnam99 ,
It is possible to attach a file via the Send API, but you need to specify the file name, content type via a MIME type, and the content as encoded in Base64. So in your example you are missing two properties in Attachments
- ContentType
and Base64Content
.
For PDF the MIME type is application/pdf
. You can see the official list of MIME types here.
For the content you can find a Base64 encoder online - e.g. here. Once you encode the file, use the resulted string as the value of Base64Content
.
Finally, make sure that you are using the correct Send API version your Mailjet account is on. The example you gave is for SendAPI v3 - if you are on SendAPI v3.1, there are some differences in the syntax and properties used. See here for more info.
from mailjet-apiv3-nodejs.
Related Issues (20)
- Object not found trying to add contact to contactList HOT 1
- Which type of Setup to use (Next.js v13, Node v18) HOT 2
- Connection timeout on send HOT 4
- [WIP] GET requests wrongly set `Content-Length` header HOT 1
- Error when sending emails using Mailjet and promises HOT 1
- cant use .connect or .apiconnect HOT 6
- The "version" field is not typed
- TypeError: Cannot create property 'mailer' on string 'host' Nest JS Service with Injectable HOT 1
- Axios update HOT 2
- invalid type ContactList ,ID property no longer exists in getcontactslists response HOT 1
- connect ETIMEDOUT 35.187.79.8:443 HOT 1
- contactslist - managecontact : name & properties not saved HOT 1
- SendMail HTML issue
- Total batch Email size exceeds individual max Email size HOT 1
- Disable automatic creation and saving of contacts when sending an email.
- Usage for batch sending undocumented
- Status "success" but no mail is sent HOT 1
- The requested module does not provide an export named 'default' HOT 2
- Uprade axios to 1.6.4 to fix CVE
- Updating transactional email Html-Part creates new draft version from another template HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailjet-apiv3-nodejs.