Fluent Mail provides an alternative to drupal_mail() with fewer convolutions and a more pleasant developer experience via a fluent interface. If you are not a developer or another module does not require it, you will derive no benefit from this module. It makes no changes on its own. To make use of the module call fluent_mail() in your code instead of drupal_mail() when you wish to send mail. How is this an improvement? Let's look at an example of sending a simple test message with drupal_mail():
<?php
/**
* Implements hook_mail().
*/
function mymodule_mail($key, &$message, $params) {
$message['subject'] = t('Test message');
$message['body'][] = t('This is a test message.');
}
/**
* Send a test email.
*/
function mymodule_send_test_mail() {
drupal_mail('mymodule', 'test_message', 'me@example.com', language_default(), array(), 'admin@example.com', TRUE);
}
?>
And the same example using fluent_mail():
<?php
/**
* Send a test email.
*/
function mymodule_send_test_mail() {
fluent_mail('mymodule', 'test_message')
->setTo('me@example.com')
->setFrom('admin@example.com')
->setSubject(t('Test message'))
->setBody(t('This is a test message.'))
->send();
}
?>