Hello
I am trying to send mail using sendgrid & Moralis cloud functions
Cloud function is triggered but mail is not sent.
Can you help me?
Logs and code are as follows.
Cloud Function;
Moralis.Cloud.define("sendEmailToUser", function (request) {
logger.info(request.params.email);
Moralis.Cloud.sendEmail({
to: request.params.email,
templateId: "d-af62eea4a96e477b8c06316c80c601b7"
});
});
Client Code;
async function subscribe () {
const email = document.getElementById('semail').value
await Moralis.Cloud.run("sendEmailToUser",{email,name});
}
Logs
2022-02-26T11:38:27.796Z - Ran cloud function sendEmailToUser for user b0yiBh4w6KfOTDpbvS8gCff3 with:
Input: {“email”:“redacted”,“name”:""}
Result: undefined