[Node.js][Mobile Apps] cc of SendGrid not working in Azure Mobile app RRS feed

  • Question

  • I have been trying to use the cc option of SendGrid in Azure Mobile app but it seems that email address set in cc field is ignored. How do we send cc using SendGrid in Azure Mobile app having JavaScript back end? It seems PHP code had this issue as well but was fixed long time back as mentioned here 

    Also, if we create the Email object first, calls its AddCc method and then pass it to SendGrid.send, it throws exception. Only the below syntax seems to work in the Azure Mobile app as explained here

          to: '**email-address**',
          from: '**from-address**',
          subject: 'New to-do item',
          text: 'A new to-do was added: ' + item.text
       }, function(success, message) {
          if (!success) {

    As can be seen above, the callback function has success parameter passed in whereas the node.js module in GitHub ( has error parameter instead. So it seems Azure mobile service is not using the same module or version, there is some disconnect there as well.

    sendgrid.send(email, function(err, message) {
       if (err) {

    Saturday, February 27, 2016 10:44 AM


  • As the default version of SendGrid in Mobile Service is "0.2.4" which is much lower than the latest one.

    there are 2 approaches you can follow to try to update the version of sendgrid in mobile service:

    1, Sign in the kudu console site of your mobile service, leverage the cmdlet online on the site to modify the "package.json" file of your mobile service application, e.g.:


    under the "dependencies" closure. Then run command : "npm update" in the cmdlet to update the sendgrid sdk in mobile service. The Kudu console site URL should be "https://<your_mobile_service_name>"

    2, You can refer to to deploy the sendgrid sdk for your own, and use 

    var sendgrid  = require('sendgrid')('YOUR_SENDGRID_API_KEY');
    in your code to implement sendgrid. 

    Any further concern, please feel free to let me know.

    Monday, February 29, 2016 2:30 AM