Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // do send email here
- $url = 'https://api.sendgrid.com/';
- $user = 'telepro_api';
- $pass = 'TeleApi4.0';
- $header = array(
- 'Authorization: Bearer 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',
- 'Content-Type: application/json'
- );
- $params = array(
- 'personalizations' => array(
- 'to' => array('quang@telepro.me'),
- 'dynamic_template_data' => array(
- 'fullname' => 'A Quang',
- 'content' => 'test noi dung transactional email'
- )
- ),
- 'subject' => '[TelepPro] $$$ into your balance!',
- 'from' => 'no-reply@telepro.me',
- 'template_id' => 'd-5c385e95cf434715b0bb961979a8beed'
- );
- $request = $url . 'v3/mail/send';
- // Generate curl request
- $session = curl_init($request);
- curl_setopt ($session, CURLOPT_POST, true);
- curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
- curl_setopt($session, CURLOPT_HTTPHEADER, $header);
- curl_setopt($session, CURLOPT_HEADER, false);
- curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
- // obtain response
- $response = curl_exec($session);
- curl_close($session);
- var_dump($response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement