Download the PHP package gryfoss/twig-smart-mailer without Composer

On this page you can find all versions of the php package gryfoss/twig-smart-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twig-smart-mailer

GryfOSS: Twig Smart Mailer

Tests status GitHub tag (latest SemVer)

Smart mailer is a simple library which assists sending of emails with use of symfony/mailer component. At the moment it requires SMTP connection, but grants features like easy embedding of images, easier attachments adding, exceptions tracking and use of string templates instead of files.

Features

Quick Start

Library Structure

Core Classes

SmartMailer

Main email sending implementation with Twig template support. Integrates with Symfony Mailer for actual email delivery.

FakeFileSmartMailer

File-based implementation for testing and development. Writes email data to JSON files instead of sending actual emails.

Message

Represents an email message with all its components including recipients, content, attachments, and embedded images.

EmailAddress

Encapsulates an email address with optional display name and validation.

Attachment

Represents a file attachment with path validation and optional custom naming.

DSN (Data Source Name) Classes

DsnInterface

Interface for creating DSN strings compatible with Symfony Mailer.

Dsn\Smtp

SMTP server DSN implementation with full configuration options.

Dsn\Gmail

Simplified Gmail DSN implementation using Symfony's Gmail transport.

Configuration Enums

EncryptionMethod

Defines available SMTP encryption methods (SSL/TLS, STARTTLS, none).

LoginMethod

Defines available SMTP authentication methods (LOGIN, PLAIN, CRAM-MD5, etc.).

Exception Hierarchy

SmartMailerException

Base exception class for all library-specific errors.

InvalidEmailAddressException

Thrown when email address format validation fails.

InvalidAttachmentException

Thrown when attachment file doesn't exist or isn't readable.

InvalidEmailMessageException

Thrown when message validation fails (missing required fields).

InvalidImageException

Thrown when attempting to embed a non-image file.

NotUniqueEmbedNameException

Thrown when trying to add an embedded image with a duplicate name.

SendException

Thrown when email sending fails.

Advanced Usage

Using Gmail Transport

Embedded Images

You can easily embed any image by using content id of the resource. If your filename is sample.png then to embed just place cid:sample.png in contents. You can also define a custom name:

Warning: Embedded image names must be unique within a message!

Twig Templates

Both HTML and text content support Twig templating:

Testing with FakeFileSmartMailer

Error Handling

Requirements

Installation

Roadmap

1.0: tests, comments ✅ 2.0: other transports than SMTP Servers 3.0: Pub/Sub queues support

Contribution

Any pull requests or issues reported are more than welcome.

License

GPL 3+


All versions of twig-smart-mailer with dependencies

PHP Build Version
Package Version
Requires symfony/google-mailer Version ^6.0 || ^7.0
symfony/mailer Version ^6.0 || ^7.0
symfony/mime Version ^6.0 || ^7.0
symfony/twig-bridge Version ^6.0 || ^7.0
twig/extra-bundle Version ^3.4
twig/twig Version ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gryfoss/twig-smart-mailer contains the following files

Loading the files please wait ...