sendinblue / APIv3-nodejs-library

SendinBlue's API v3 Node.js Library
ISC License
101 stars 47 forks source link

Add inline images complete example in Node.js - SMTP SendEmail #69

Closed CezarCobuz closed 1 year ago

CezarCobuz commented 4 years ago

Everything works just fine for the sending email functionality but the documentation is clearly lacking some strong, and complete examples, a good one would be how to add inline-images inside an email. The example here, from the sendinblue apidocs is solid, but unfortunately it's for an older version. And doesn't seem to work in v3.

What interests me most is to add images with their base64 encodings. Similar to:

"html" : "This is the <h1>HTML</h1>
    This is inline image 1.<br/>
    <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>     Some text<br/>      This is inline image 2.<br/>        <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
    Some more text<br/>
    Re-used inline image 1.<br/>
    <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
"attachment" : {"myfilename.pdf":"your_pdf_files_base64_encoded_chunk_data"},
"headers" : {"Content-Type": "text/html;charset=iso-8859-1","X-param1": "value1", "X-param2": "value2","X-Mailin-custom":"my custom value", "X-Mailin-IP": "102.102.1.2", "X-Mailin-Tag" : "My tag"},
"inline_image" : {"myinlineimage1.png" : "your_png_files_base64_encoded_chunk_data","myinlineimage2.jpg" : "your_jpg_files_base64_encoded_chunk_data"}

but in this version, and make use of content property. from the SibApiV3Sdk.SendSmtpEmail.

Gresliebear commented 2 years ago

The documentation doesn't help how to send multiple images in a image at once etc

shubhamUpadhyayInBlue commented 1 year ago

Hi @CezarCobuz and @Gresliebear Thank you for your feedback, we would definitely try to improve the examples in the new routes.