parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.92k stars 4.78k forks source link

TypeError: Parse.Cloud.sendEmail is not a function #7620

Closed tiavina-mika closed 3 years ago

tiavina-mika commented 3 years ago

New Issue Checklist

Issue Description

Can not send an email via Parse.Cloud.sendEmail

Steps to reproduce

// in cloud code
Parse.Cloud.define(
  'sendProjectEmail',
  async (request) => {
    await Parse.Cloud.sendEmail({
      templateName: "projectEmail",
      placeholders: { appName: 'TiksApp' },
      // user: parseUser // user with email address
      recipient: 'tiavinamika@gmail.com'
    });
  },
);
// run the cloud function
await Parse.Cloud.run('sendProjectEmail');

Actual Outcome

  Result: "Parse.Cloud.sendEmail is not a function" {"functionName":"sendProjectEmail","params":{}}
Trace: TypeError: Parse.Cloud.sendEmail is not a function

Expected Outcome

the email should be sent

Environment

Server

Database

Client

Logs

Trace: TypeError: Parse.Cloud.sendEmail is not a function
    at E:\tiavina-mika\portfolio-v3\cloud\hooks\users.js:19:34
    at E:\tiavina-mika\portfolio-v3\cloud\utils\utils.js:7:26
    at E:\tiavina-mika\portfolio-v3\node_modules\parse-server\lib\Routers\FunctionsRouter.js:173:16
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at E:\tiavina-mika\portfolio-v3\cloud\utils\utils.js:14:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
info: Ran cloud function sendProjectEmail for user undefined with:
  Input: {}
  Result: "Parse.Cloud.sendEmail is not a function" {"functionName":"sendProjectEmail","params":{}}
Trace: TypeError: Parse.Cloud.sendEmail is not a function
    at E:\tiavina-mika\portfolio-v3\cloud\hooks\users.js:19:34
    at E:\tiavina-mika\portfolio-v3\cloud\utils\utils.js:7:26
    at E:\tiavina-mika\portfolio-v3\node_modules\parse-server\lib\Routers\FunctionsRouter.js:173:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at E:\tiavina-mika\portfolio-v3\cloud\utils\utils.js:14:17
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
info: Ran cloud function sendProjectEmail for user undefined with:
  Input: {}
  Result: "Parse.Cloud.sendEmail is not a function" {"functionName":"sendProjectEmail","params":{}}
parse-github-assistant[bot] commented 3 years ago

Thanks for opening this issue!

mtrezza commented 3 years ago

The function is currently only available in Parse Server 5.0.0-beta.1.

I'm closing this issue as it is not a Parse Server issue. For help with Parse Server we recommend our community forum.