Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add someone in copy via the SDK #54

Open
MilesYM opened this issue Mar 11, 2024 · 0 comments
Open

Cannot add someone in copy via the SDK #54

MilesYM opened this issue Mar 11, 2024 · 0 comments

Comments

@MilesYM
Copy link

MilesYM commented Mar 11, 2024

Hello

I am following the documentation to add someone in cc with the SDK 4.2.5 however I receive an error message saying this method does not exist:

`public function sendEmail($to, $name, $message, $subject, User $user)
{
if (!$to)
return false;
$this->nylas->Options()->setAccessToken($user->getOAuthToken());
$this->nylas->Options()->setAccountId($user->getNylasAccountId());

    $params = [
        'to' => [
            [
              'email' => $to,
              'name' => $name,
            ],
        ],
        'tracking' => [
            'links' => false,
            'opens' => true,
            'thread_replies' => $user->getMailboxWhitelisted() ? true : false,
        ],
        'body' => $message,
        'subject' => $subject,
    ];

    if ($user->getBrokerUser() && $user->getBrokerUser()->getId() === 14824) {
        $params['cc'] =
            [
                "name" => "First Name Last Name",
                "email" => "[email protected]"
            ];
    }

    return $this->nylas->Messages()->Sending()->sendDirectly($params);
}`

Whenever I add the 'cc' parameter, it returns an error message and nothing is sending.

Is there an issue with the cc paramter or am I doing something wrong?

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant