tuxone/postmark-bundle

postmark bundle

Installs: 62

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 12

Type:symfony-bundle

v0.0.6 2013-09-12 14:29 UTC

This package is auto-updated.

Last update: 2024-05-04 22:18:35 UTC


README

Symfony2 bundle forked from https://github.com/miguel250/PostmarkBundle

Addons

Fake Attachment Attach fake text files

/**
     * Add fake attachment
     *
     * @param string $file
     * @param string $filename  null
     * @param string $mimeType  null
     * @return Message
     */
    public function addFakeAttachment($file, $filename, $mimeType)
    {

        $this->attachments[] = array(
            'Name'        => $filename,
            'Content'     => base64_encode($file),
            'ContentType' => $mimeType
        );

        return $this;
    }

Usage

Message Service

<?php
$message  = $this->get('postmark.message');
$message->addTo('test@gmail.com', 'Test Test');
$message->setSubject('subject');
$message->setHTMLMessage('<b>email body</b>');
$message->addFakeAttachment('Hello world', 'filename.txt', 'text/plain');
$response = $message->send();

?>