1. Go to this page and download the library: Download dekalee/mailjet-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dekalee / mailjet-bundle example snippets
namespace Bar;
use Dekalee\MailjetBundle\Message\SwiftCustomVarsMessage;
class FooMessage extends SwiftCustomVarsMessage {}
$message = new FooMessage();
$message->setVars(['bar' => 'baz']);
php
class RegisterUser
{
protected $subscriber;
public function __construct(ContactListSubscriber $subscriber)
{
$this->subscriber = $subscriber;
}
public function addUser(User $user)
{
$this->subscriber->subscribe(
'campaignName',
$user->getEmail(),
[
'subject' => 'Mail subject (linked to the user)',
'content' => 'Mail content (linked to the user)',
]
);
}
}
php
class UnRegisterUser
{
protected $unsubscriber;
public function __construct(ContactListUnsubscriber $unsubscriber)
{
$this->unsubscriber = $unsubscriber;
}
public function delUser(User $user)
{
$this->unsubscriber->unsubscribe('campaignName', $user->getEmail());
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.