Skip to content

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

@kzokjit

Description

@kzokjit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions