Parse.Cloud.define("email", function(request, response) {
var Mandrill = require('mandrill');
Mandrill.initialize('Dz74nd7RNATpV2Fj3tZ2yg');
Mandrill.sendEmail({
message: {
text: request.params.text,
subject: "otp!",
from_email: "[email protected]",
from_name: "hakim",
to: [
{
email: request.params.email,
name: "Some Name"
}
]
},
async: true
},{
success: function(httpResponse) {
response.success("email sent");
},
error: function(httpResponse) {
}
}
);
});
Parse.Cloud.define("email", function(request, r