コード例 #1
1
 /**
  * Send a transactional email
  *
  * @param TransactionalEmail $tEmail
  */
 public function send(TransactionalEmail $tEmail)
 {
     $attributes = $this->handleAttributes($tEmail->getAttributes());
     $recipients = $this->handleRecipients($tEmail->getRecipients());
     $recipientsCc = $this->handleRecipients($tEmail->getCarbonCopies());
     $recipientsBcc = $this->handleRecipients($tEmail->getBlindCarbonCopies());
     $to = implode('|', $recipients);
     $cc = implode('|', $recipientsCc);
     $bcc = implode('|', $recipientsBcc);
     $attachmentUrl = '';
     $attachment = array();
     $this->service->send_transactional_template(array('id' => $tEmail->getTemplateId(), 'to' => $to, 'cc' => $cc, 'bcc' => $bcc, 'attr' => $attributes, 'attachment_url' => $attachmentUrl, 'attachment' => $attachment, 'headers' => array()));
 }
コード例 #2
1
ファイル: tutorial3.php プロジェクト: ddisseny/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will send a transactional SMS
 *
 */
/** Prepare variables for easy use **/
$data = array("to" => "+331234567890", "from" => "From", "text" => "Good morning - test", "web_url" => "http://example.com", "tag" => "Tag1", "type" => "");
var_dump($mailin->send_sms($data));
コード例 #3
0
 /**
  * @param string $email  The email address of the member to retrieve.
  *
  * @return Member
  * @throws \Exception
  */
 public function findByEmail($email)
 {
     if (empty($email)) {
         throw new \Exception('Member email is required.');
     }
     $response = $this->service->get_user($email);
     $member = $this->memberHandleResponse($response);
     return $member;
 }
コード例 #4
0
ファイル: tutorial1.php プロジェクト: sasaaa/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/** Prepare variables for easy use **/
$to = array("*****@*****.**" => "to whom!");
//mandatory
$subject = "My subject";
//mandatory
$from = array("*****@*****.**", "from email!");
//mandatory
$html = "This is the <h1>HTML</h1>";
//mandatory
$text = "This is the text";
$cc = array("*****@*****.**" => "cc whom!");
$bcc = array("*****@*****.**" => "bcc whom!");
$replyto = array("*****@*****.**", "reply to!");
$attachment = array();
//provide the absolute url of the attachment/s
$headers = array("Content-Type" => "text/html; charset=iso-8859-1", "X-Ewiufkdsjfhn" => "hello", "X-Custom" => "Custom");
var_dump($mailin->send_email($to, $subject, $from, $html, $text, $cc, $bcc, $replyto, $attachment, $headers));
コード例 #5
0
ファイル: tutorial3.php プロジェクト: sasaaa/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will send an SMS
 *
 */
var_dump($mailin->send_sms("1231231313", "From!", "This is a test", "http://example.com", "tag1"));
コード例 #6
0
ファイル: tutorial2.php プロジェクト: sasaaa/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will get all your campaigns
 *
 */
var_dump($mailin->get_campaigns_v2());
コード例 #7
0
ファイル: tutorial1.php プロジェクト: ddisseny/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will send a transactional email
 *
 */
/** Prepare variables for easy use **/
$data = array("to" => array("*****@*****.**" => "to whom!"), "cc" => array("*****@*****.**" => "cc whom!"), "bcc" => array("*****@*****.**" => "bcc whom!"), "from" => array("*****@*****.**", "from email!"), "replyto" => array("*****@*****.**", "reply to!"), "subject" => "My subject", "text" => "This is the text", "html" => "This is the <h1>HTML</h1><br/>\n\t\t\t\t\t   This is inline image 1.<br/>\n\t\t\t\t\t   <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>\n\t\t\t\t\t   Some text<br/>\n\t\t\t\t\t   This is inline image 2.<br/>\n\t\t\t\t\t   <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>\n\t\t\t\t\t   Some more text<br/>\n\t\t\t\t\t   Re-used inline image 1.<br/>\n\t\t\t\t\t   <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">", "attachment" => array(), "headers" => array("Content-Type" => "text/html; charset=iso-8859-1", "X-param1" => "value1", "X-param2" => "value2", "X-Mailin-custom" => "my custom value", "X-Mailin-IP" => "102.102.1.2", "X-Mailin-Tag" => "My tag"), "inline_image" => array('myinlineimage1.png' => "your_png_files_base64_encoded_chunk_data", 'myinlineimage2.jpg' => "your_jpg_files_base64_encoded_chunk_data"));
var_dump($mailin->send_email($data));
コード例 #8
0
ファイル: tutorial2.php プロジェクト: ddisseny/mailin-api-php
<?php

use Sendinblue\Mailin;
/*
 * This will initiate the API with the endpoint and your access key.
 *
 */
$mailin = new Mailin('https://api.sendinblue.com/v2.0', 'Your access key');
/*
 * This will get all your campaigns
 *
 */
/** Prepare variables for easy use **/
$data = array("type" => "classic", "status" => "queued", "page" => 1, "page_limit" => 10);
var_dump($mailin->get_campaigns_v2($data));