PHP code example of ajtarragona / mailrelay-client

1. Go to this page and download the library: Download ajtarragona/mailrelay-client 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/ */

    

ajtarragona / mailrelay-client example snippets


use MailRelay;
...
public  function  test(){
    $remitents=MailRelay::getSenders();
    ...
}

'aliases'  =>  [
    ...
    'MailRelay'  =>  Ajtarragona\MailRelay\Facades\MailRelay::class
]

use Ajtarragona\MailRelay\MailRelayService;
...

public  function  test(MailRelayService  $mailrelay){
    $remitents=$mailrelay->getSenders();
    ...
}

...
public  function  test(){
    $remitents=mailrelay()->getSenders();
    ...
}

MailRelay::createImport("prueba api",[
  [
    "name"=>"juan",
    "email"=>"[email protected]",
    "custom_field_17"=>"a"
  ],
  [
    "name"=>"Luis d'Àvila",
    "email"=>"[email protected]",
    "custom_field_17"=>"bb"
  ]
],[13]);


$sender=MailRelay::getSender(2);
$sender->delete();

$sender=MailRelay::getSender(2);
$sender->update([
    "name"=>"Nuevo nombre"
]);

$sender=MailRelay::getSender(2);
$sender->sendConfirmationMail();

$boletin=MailRelay::getCampaign(5);
$informe=$boletin->send();
bash
php artisan vendor:publish --tag=ajtarragona-mailrelay-config