Download the PHP package vkr/external-email-bundle without Composer

On this page you can find all versions of the php package vkr/external-email-bundle. 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 external-email-bundle

About

This bundle, in its present state, can do two things. First, it fetches an external file (either from your system or from the internet) and sends it as an email message. Second, it can also replace any wildcard that is included in that file into any value you want. The rules for wildcard parsing can include any kind of PHP code.

Installation

This bundle depends on Symfony and VKRSettingsBundle, see that bundle's docs for details of its installation.

You need to configure some settings.

mailer_from_address and mailer_from_name correspond to the name and address in email From header.

There are two more settings with arbitrary names, one for the external file location, and another for the email subject. You need to define a pair of these settings for every message you want to send using this bundle. File location settings can be either full system paths or URLs.

See VKRSettingsBundle documentation on how to configure settings.

Usage

Without wildcards

If you don't have any wildcards, the usage is trivial. Write this code in your controller:

With wildcards

You can include an arbitrary number of wildcards to be parsed in your external file. If you choose to use them, you need to write some extra code.

Wildcard names

Wildcard names can include only alphanumeric uppercase ASCII characters and underscores and must begin with a letter. You need to include % signs before and after a wildcard:

Wildcard parsers

For every wildcard you create, you need to write a parser class that defines how this wildcard will be transformed. A parser class is just a PHP class that must implement VKR\ExternalEmailBundle\Interfaces\EmailParserInterface and define its parse() method.

The parser class name should conform to a convention: camel-cased wildcard name with 'Parser' appended to it. So, if your wildcard is called MY_WILDCARD, your parser class should be called MyWildcardParser. There is no convention regarding namespaces for those classes.

Here is an example of a simple parser class:

This code means that every instance of in your external file will be converted to .

After defining your parser classes, you must bootstrap them. In order to do it, you must pass an array of parser class instances as the fourth argument to the parse() method.

It is recommended that you register all your parsers as Symfony services and instantiate them via $this->get().

Additional arguments

You might want to pass arguments to your parser's parse() method. In order to do it, you can specify any number of additional arguments and pass them as a fifth argument.

Then, in your parser:

Now will be changed to 'bar' rather than 'foo'.

An important thing to note is that if you have several parsers, all arguments will be passed to every parser. To avoid unexpected behavior, use unique argument names for every parser you have.

API

void ExternalEmailParser::__construct(VKR\SettingsBundle\Services\SettingsRetriever $settingsRetriever)

Swift_Message ExternalEmailParser::parse(string $emailFileSettingName, string $emailSubjectSettingName, string $receiverAddress, VKR\ExternalEmailBundle\Interfaces\EmailParserInterface[] $wildcardParsers, array $additionalArguments=[])

The fourth argument cannot be empty, if you don't have any parsers, pass empty array.


All versions of external-email-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/symfony Version ~2.8|~3.0
vkr/settings-bundle Version ~1.1
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 vkr/external-email-bundle contains the following files

Loading the files please wait ....