parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Cloud Code Mandrill with parse server giving error.

Open vikas230428 opened this issue 10 years ago • 1 comments

The other simple cloud functions are working fine after push from 'cloud/main.js' to heroku server But when I add mandrill script it gives an error on app end as: [Error]: Invalid function. (Code: 141, Version: 1.13.0) I have installed Mandrill version '~0.1.0' into parser-server-example folder after adding the mandrill version into package.json file and push the code to heroku. But still the issue is same. Here is my cloud code:

`Parse.Cloud.define("sendMail", function(request, response) {
                   var Mandrill = require('mandrill');
                   Mandrill.initialize('xxxxxxxxxx');
               Mandrill.sendEmail({
                                  message: {
                                  text: "ffff",
                                  subject: "hello",
                                  from_email: "[email protected]",
                                  from_name: "pqr",
                                  to: [
                                       {
                                       email: "[email protected]",
                                       name: "trump"
                                       }
                                       ]
                                  },
                                  async: true
                                  },{
                                  success: function(httpResponse) {
                                  console.log(httpResponse);
                                  response.success("Email sent!");
                                  },
                                  error: function(httpResponse) {
                                  console.error(httpResponse);
                                  response.error("Uh oh, something went wrong");
                                  }
                                  });
               });`

Please let me know if there is anything wrong? I have tried to install mandrill latest version but parse server does not installing the versions other than ~0.1.0

vikas230428 avatar Mar 24 '16 18:03 vikas230428

Unfortunately we can't support Mandrill specific issues here. If you do find a solution, though, please post it so that others can benefit it. You might have some luck by catching and logging all exceptions, updating your dependencies, and logging more errors from your app.

drew-gross avatar Mar 30 '16 23:03 drew-gross