1. Go to this page and download the library: Download netcore/module-email 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/ */
netcore / module-email example snippets
use Modules\Email\Models\AutomatedEmail;
use Netcore\Translator\Helpers\TransHelper;
$emails = [
[
'key' => 'verify_email',
'period' => 'now',
'type' => 'static', // Available types: static, period, interval
'is_active' => true,
'translations' => [
'name' => 'Email verification',
'text' => 'Please verify your email by clicking on the link: <a href="[VERIFICATION_URL]">[VERIFICATION_URL]</a>'
]
]
];
foreach ($emails as $email) {
$emailModel = AutomatedEmail::create(array_except($email, 'translations'));
$translations = [];
foreach (TransHelper::getAllLanguages() as $language) {
$translations[$language->iso_code] = $email['translations'];
}
$emailModel->updateTranslations($translations);
}