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 :: CausesActivity trait 
Php :: php undefined array key 
Php :: implode (PHP 4, PHP 5, PHP 7, PHP 8) implode — Join array elements with a string 
Php :: smarty shorthand if 
Php :: php wxplode 
Php :: Parameters inside Laravel localized string 
Php :: laravel openstreetmap 
Php :: Lity in Wordpress 
Php :: run seeder command in laravel 
Php :: chunk in laravel 
Php :: laravel windows stop serving 
Php :: php oops 
Php :: what is the fee/commission charge for payoneer 
Php :: PHP ord — Convert the first byte of a string to a value between 0 and 255 
Php :: symfony translation variable in twig 
Php :: doctrine remove element from arraycollection 
Php :: http://www.endmemo.com/program/R/vector.php 
Php :: bootstrap autocomplete example ajax php mysql 
Php :: what does php stand for 
Php :: add image thumb on checkout woo 
Php :: multible many routes same controller 
Php :: laravel DomPDF live preview 
Php :: function to fetch user details 
Php :: get current tax page 
Php :: Argument 1 passed to DoctrineInflectorInflector::singularize() must be of the type string, null given, 
Php :: set session expire time in php 
Php :: how to change laravel logo image 
Php :: php print keys of array 
Php :: Simple half pyramid pattern 
Php :: validation sellphone laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =