Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.
Manuel edited this page Feb 9, 2016 · 3 revisions

Mailrelay Bundle

This bundle allows you to send, manage and track messages sent using Mailrelay.com. We're not related or part of Mailrelay company. You will need also a Mailrelay account and a active subscription to access their API.

Important! This bundle is under a heavy development and some features may be/are not available yet. Use it under your very own discretion and responsibility.

Also, this documentation itself may receive changes without any warning. All methods available in this bundle are a implementation of Mailrelay's API. The goal of this documentation is to learn about this bundle works, but not as a sustitute of Mailrelay's documentation.


Documentation

General functions

sendMail

This method allow you to quickly send a mailing list, without be able to manage sending (pausing, resuming, etc.).

use Arrogance\MailrelayBundle\Email;

// ...

$client = $this->get('arrogance_mailrelay.client');

$email = new Email();

// The following properties are mandatory to a successful send.
$email->addEmail('User name', 'user@email.io')
    ->addEmail('Another User', 'another@email.io')
    ->setSubject('This is a testing');

// As message you can insert html or use a twig view
$email->setHtml($this->get('twig')->render('@YourBundle/Path/to/template.html.twig', array()));

// From/Reply/Report to account
// You can add your own email accounts to sending, tracking, etc. of your sendings.
// $client->getMailboxes(); to view your accounts
$email->fromId(5)
    ->replyId(5)
    ->reportId(3);

// Active Mailrelay subscription (user plan, package, etc.)
// View yours with $client->getPackages();
$email->setPackage(6);

$client->sendMail($email); // Returns true if emails were corrected placed on mailing list queue.

SMTP

getSmtpTags

Get a list of smtp tags.

$client = $this->get('arrogance_mailrelay.client');

$optional = array(
	'offset' => (integer) // Optional parameter to specify offset.
	'count' => (integer) // Optional parameter to specify the number of records.
	'id' => (integer) // Optional parameter to search by id.
	'tag' => (string) // Optional parameter to search by tag.
	'sortField' => (string) // Optional parameter to specify a search field.
	'sortOrder' => (string) // Optional parameter to specify a sort order. Accepted values are ASC and DESC (default).
);
$response = $client->getSmtpTags($optional);

Clone this wiki locally