PHP code example of elliotsawyer / managed-emails

1. Go to this page and download the library: Download elliotsawyer/managed-emails 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/ */

    

elliotsawyer / managed-emails example snippets


        /**
         * $messageBody = 'Hi {$Member.Email}, this is from {$FromPerson} located at {$Address}.'
         * **/
        $email = ManagedEmail::get()->find('Label', 'EXAMPLE_MESSAGE');
        if ($email && $email->ID) {
            //send a message to an email address, with template variables defined
            $email->send('[email protected]', [
                'Member' => Member::get()->first(),
                'FromPerson' =>  'Elliot Sawyer',
                'Address' => '1234 Nowhere Street'
            ]);
        }