javascript - Getting "TypeError: undefined is not a function" when trying to send email using mailgun -
i trying send email using mailgun , have given code below
parse.cloud.define("sendemail", function(request, response) { var mailgun = require('mailgun'); mailgun.initialize('domainname', 'myapikey'); mailgun.sendemail({ to: "test@test.com" , from: "test@test.com", subject: "title", text: "contents" },{ success: function() { response.success(request.params); console.log("--email sent - success"); console.log(request.params); }, error: function() { console.log("--failed send email - success"); console.error(request.params); response.error("uh oh, went wrong"); } }); });
but recieving error typeerror: undefined not function
in line parse.cloud.define("sendemail", function(request, response)
, not sending email, new mailgun , parse, please assist me, thank in advance
i ran code in own cloudcode instance, , executes fine. post entire main.js file please? there may formatting issue or such.
Comments
Post a Comment