PHP code example of vkr / external-email-bundle

1. Go to this page and download the library: Download vkr/external-email-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vkr / external-email-bundle example snippets


$emailParser = $this->get('vkr_external_email.parser');
$message = $emailParser->parse('file_location_setting', 'email_subject_setting',
                               '[email protected]', []);
$mailer = $this->get('mailer');
$mailer->send($message);

class MyWildcardParser implements VKR\ExternalEmailBundle\Interfaces\EmailParserInterface
{
    public function parse($additionalArguments=[])
    {
        return 'foo';
    }
}

$wildcardParsers = [
    new MyWildcardParser(),
];
$args = [
    'value' => 'bar',
];
$message = $emailParser->parse('file_location_setting', 'email_subject_setting',
                               '[email protected]', $wildcardParsers);

    public function parse($additionalArguments=[])
    {
        if (isset($additionalArguments['value'])) {
            return $additionalArguments['value'];
        }
        return 'foo';
    }