Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sendinblue send mail

$config = new Configuration();
$config->setApiKey('api-key', $_ENV['SENDINBLUE_KEY']);
$apiInstance = new ContactsApi(
  new  client(),
  $config
);
$apiInstance = new TransactionalEmailsApi(
  new Client(),
  $config
);
$sendSmtpEmail = new SendSmtpEmail();
$sendSmtpEmail['to'] = array(array('email' => $_POST['email']));
$sendSmtpEmail['templateId'] = 59;
$sendSmtpEmail['params'] = array('texte' => '', 'surname' => 'Doe');
$sendSmtpEmail['headers'] = array('X-Mailin-custom' => 'custom_header_1:custom_value_1|custom_header_2:custom_value_2');

try {
  $result = $apiInstance->sendTransacEmail($sendSmtpEmail);
  print_r($result);
} catch (Exception $e) {
  echo 'Exception when calling TransactionalEmailsApi->sendTransacEmail: ', $e->getMessage(), PHP_EOL;
}
 
PREVIOUS NEXT
Tagged: #sendinblue #send #mail
ADD COMMENT
Topic
Name
3+8 =