Mails : sync

Synchronizing mail content

The sync() method is used to update headers. It updates the previously set headers such as the mail recipients. When this is used, it overides or modifies the default $webmail data set. Unlike inline configuration, it can be used to modify file attachments and supports multiple files.

Some few examples below provides a better insight to how this is done.

Sample: Loading mail content
    <?php

      $mailer = new Mailer;

      ... //other codes here

      $mailer->content('mail.body', 'file'); // load as a file    
      
      $mailer->sync('client', ['user' => 'foo@mail.com', 'name' => 'foo']); 

      $mailer->sync('file', ['http://site.com/filepath.ext']); // file attachment