REMINDER
Email with attachments
-
Hi Team,
I had a scenario to send emails with multiple attachments. Attachments will be saved in Cloudbackend Uploads folder. I thought of using cloudbackend api to do that. But below github snippet is not working for excel files. How can i achieve it to send with multiple attachments of files saved in Uploads folder.
Snippet
var request = require('request').defaults({ encoding: null });
var imgURL = "https://upload.wikimedia.org/wikipedia/en/0/0b/Nickelodeon_SpongeBob_SquarePants_Characters_Cast.png";request.get(imgURL, function (err, res, body) {
var attachments =[{
filename : "mypicture.jpg",
content: body
}];
var replyTo = [{
email : "johnny.doe@yopmail.com",
name : "Johnny Doe"
}];cloudbackend.sendEmailAdvanced("john.doe@yopmail.com", "John Doe", "barbara.dess@yopmail.com", "michel.ane@yopmail.com;sarah.croche@yopmail.com;jeremy.sciglio@yopmail.com", "frank.spritz@yopmail.com", "Hello", "How are you?", attachments, false, replyTo) .then(function(response) { console.log(response); });
});
-
Hi,
First of all, no problem with multi-attachement and xls files, I just did a try with the npm package sample:
So if you want to use cloudbackend uploaded files you still need to read it using request as our example shows and the only difference is the URL you provide.
It would looks like :
var fileURL = 'https://yourappid.appdrag.site/whateverfolder/myxlsfile.xls
-
@Wassim
It works -
Perfect !