Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

sendinblue send email

//working_directory/emailBuilder.php

require_once(__DIR__ . '/vendor/autoload.php');

$credentials = SendinBlueClientConfiguration::getDefaultConfiguration()->setApiKey('api-key', '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');
$apiInstance = new SendinBlueClientApiTransactionalEmailsApi(new GuzzleHttpClient(),$credentials);

//#######################################//
$sendSmtpEmail = new SendinBlueClientModelSendSmtpEmail([
     'subject' => 'Réinitialisation du mot de passe',
     'sender' => ['name' => 'Clever Support', 'email' => 'contact@clever.how'],
     'replyTo' => ['name' => 'Clever Support', 'email' => 'contact@clever.how'],
     'to' => [[ 'name' => 'Support', 'email' => $dn['email']]],
	 'templateId' => 6,
     'params' => ['reset_link' => 'https://clever.how/v3/reset_process.php?email='.$email.'&key='.$key.'']
]);

try {
    $result = $apiInstance->sendTransacEmail($sendSmtpEmail);
    // print_r($result);
	
	 $reponse = 'ok';
		
} catch (Exception $e) {
    // echo '<small>Exception when calling TransactionalEmailsApi->sendTransacEmail: </small>', $e->getMessage(), PHP_EOL;

	 $reponse = 'Nous avons rencontré un problème. Merci de nous écrire à contact@clever.how';
		
}
Comment

PREVIOUS NEXT
Code Example
Php :: iteration in php 
Php :: php remove anchor tag from string 
Php :: faker laravel 
Php :: get all category custom post type wordpress dev 
Php :: php remove everything after symbol 
Php :: php replace all spaces with dashes 
Php :: clear array php 
Php :: php strftime 
Php :: php pdo check if update query successful 
Php :: laravel collection search by value 
Php :: php get client mac address 
Php :: php short string 
Php :: getMessage in php 
Php :: php ob_start 
Php :: get ip country 
Php :: laravel get all session data 
Php :: image store short method in laravel 
Php :: pass in php 
Php :: break and continue in laravel 
Php :: add two numbers as string in php 
Php :: laravel collection reject 
Php :: how to retrieve data from database using select option in laravel 
Php :: var_dump php 
Php :: how to use plugin shortcode in wordpress template 
Php :: array prepend php 
Php :: laravel session add 
Php :: laravel custom log 
Php :: eloquent with select 
Php :: php destroy session after some time 
Php :: how to create controller inside folder in laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =