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

Unable to pass transactional param to the template via API #151

Closed
kzokjit opened this issue May 4, 2021 · 2 comments
Closed

Unable to pass transactional param to the template via API #151

kzokjit opened this issue May 4, 2021 · 2 comments

Comments

@kzokjit
Copy link

kzokjit commented May 4, 2021

I followed the documentation and followed the php api but i m not able to send the param to the template.

I have defined it {{params.activation-link}} but always return zero

Check php code below

   $instance = $this->transactionalEmailsApi();
        $sendSmtpEmail = new \SendinBlue\Client\Model\SendSmtpEmail();
        $sendSmtpEmail['subject'] = 'Registration';

        $sendSmtpEmail['sender'] = array(
            'name' => $this->senderName,
            'email' => $this->senderEmail);


        $sendSmtpEmail['to'] = array(
            $params
        );
        $sendSmtpEmail['templateId'] = 4;
        $sendSmtpEmail['replyTo'] = array('email' => $this->replyTo, 'name' => $this->senderName);
       
       $param['activation-link'] = 'testing link';
        $sendSmtpEmail['params'] = $param;

        try {
            $result = $instance->sendTransacEmail($sendSmtpEmail);
            print_r($result);
        } catch (Exception $e) {
            echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
        }

Please advice

@rajatsib
Copy link
Contributor

rajatsib commented May 11, 2021

Hi @kzokjit

Please don't use '-' in your params. You can use '_' like activation_link or any other format (eg: camelCase).
It should work then.

Thanks

@kzokjit
Copy link
Author

kzokjit commented May 11, 2021

Thanks for the answer. True sendinblue support replied to it

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

2 participants