Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Email with attachments

    Cloud Backend (Cloud DB, API Builder)
    3
    4
    522
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vinoth kumar
      vinoth kumar last edited by

      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);
      });
      

      });

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        Hi,

        First of all, no problem with multi-attachement and xls files, I just did a try with the npm package sample:

        239a90c7-6b9d-4482-a343-f93ec0c65711-image.png

        5ba10999-dfee-414b-8b08-e9579f184f73-image.png

        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
        
        vinoth kumar 1 Reply Last reply Reply Quote 1
        • vinoth kumar
          vinoth kumar @Wassim last edited by

          @Wassim
          It works

          1 Reply Last reply Reply Quote 0
          • Wassim
            Wassim last edited by

            🙏 Perfect !

            1 Reply Last reply Reply Quote 0
            • First post
              Last post