Skip to content

Cloud Code Mandrill with parse server giving error. #1179

Closed
@vikas230428

Description

@vikas230428

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions