Pakyow has built-in mechanisms for delivering views through email. The easiest way to user mailers is from a route. Here's a basic example:
The view will be constructed just like it would be if it was being presented in a browser. You can also access the view for manipulation and binding:
mailer = mailer(view_path) mailer.view.scope(:foo).apply(some_data) mailer.deliver_to(['email@example.com', 'firstname.lastname@example.org'])
Access to the mail message object is also available:
mailer = mailer(view_path) mailer.message.subject = 'Pakyow Rocks!' mailer.message.add_file('/path/to/file.jpg') mailer.deliver_to('email@example.com')
There are several configuration settings for Mailer. See configuration for more information.