notifications template

This commit is contained in:
vedatakd 2021-04-03 19:38:14 +03:00
parent 7e8270017b
commit c2720bd65f
4 changed files with 281 additions and 0 deletions

View File

@ -1,12 +1,16 @@
<?php namespace Visiosoft\AdvsModule;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Visiosoft\AdvsModule\Notifications\AdvsModuleNotificationsTemplateSeeder;
use Visiosoft\AdvsModule\Status\StatusSeeder;
class AdvsModuleSeeder extends Seeder
{
public function run()
{
//Notifications Template Seeder
$this->call(AdvsModuleNotificationsTemplateSeeder::class);
$this->call(StatusSeeder::class);
}
}

View File

@ -0,0 +1,86 @@
<?php namespace Visiosoft\AdvsModule\Notifications;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Support\Str;
use Visiosoft\NotificationsModule\Template\Contract\TemplateRepositoryInterface;
class AdvsModuleNotificationsTemplateSeeder extends Seeder
{
public function run()
{
if (is_module_installed('visiosoft.module.notifications')) {
$template_repo = app(TemplateRepositoryInterface::class);
if (!$template_repo->findBySlug(Str::slug('Created Ad', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>&nbsp;Your post <a href="{url}" target="_blank">{name}</a> has been created successfully.</strong></p>',
'name' => 'Created Ad',
'greeting' => 'Hi',
'subject' => 'Created Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Created Ad', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('Approved Ad', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>Your ad for&nbsp;<a href="{url}" target="_blank">{name}</a>&nbsp;has been approved.</strong></p>',
'name' => 'Approved Ad',
'greeting' => 'Hi',
'subject' => 'Approved Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Approved Ad', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('Declined Ad', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>Your <a href="{url}" target="_blank">{name}</a>&nbsp;ad was rejected because it does not comply with the posting rules.</strong></p>',
'name' => 'Declined Ad',
'greeting' => 'Hi',
'subject' => 'Declined Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Declined Ad', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('Pending User Ad', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>You must confirm your <a href="{url}" target="_blank">{name}</a>&nbsp;posting to be published.</strong></p>',
'name' => 'Pending User Ad',
'greeting' => 'Hi',
'subject' => 'Pending User Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Pending User Ad', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('Pending Ad', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>Your <a href="{url}" target="_blank">{name}</a> post is checked by our editors.</strong></p>',
'name' => 'Pending Ad',
'greeting' => 'Hi',
'subject' => 'Pending Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Pending Ad', '_')
]);
}
}
}
}

View File

@ -0,0 +1,187 @@
<?php namespace Visiosoft\ProfileModule\Notifications;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Support\Str;
use Visiosoft\NotificationsModule\Template\Contract\TemplateRepositoryInterface;
class ProfileModuleNotificationsTemplateSeeder extends Seeder
{
public function run()
{
if (is_module_installed('visiosoft.module.notifications')) {
$template_repo = app(TemplateRepositoryInterface::class);
if (!$template_repo->findBySlug(Str::slug('Registered User', '_'))) {
$template_repo->create([
'en' => [
'message' => '<p><strong>Your membership is activated.<br>Email:{email}</strong></p>',
'name' => 'Registered User',
'greeting' => 'Hi {first_name}',
'subject' => 'Your Membership Has Been Successfully Created!'
],
'stream' => 'users',
'slug' => Str::slug('Registered User', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('New User Welcome', '_'))) {
$template_repo->create([
'en' => [
'message' => '<tr>
<td class="esd-structure es-p20t es-p20b es-p20r es-p20l" align="left">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="esd-container-frame" width="560" valign="top" align="center">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="esd-block-text es-m-txt-l es-p15t es-p15b es-m-p15t es-m-p0b es-m-p0r es-m-p0l" align="left">
<h2 style="font-size: 26px;"><strong>Welcome to openclassify</strong></h2>
</td>
</tr>
<tr>
<td class="esd-block-text es-p20t" align="left">
<p style="color: #707070; font-size: 16px;">Hi user,</p>
</td>
</tr>
<tr>
<td class="esd-block-text es-p15t" align="left">
<p style="color: #707070; font-size: 16px;">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
</td>
</tr>
<tr>
<td class="esd-block-text es-p15t" align="left">
<p style="color: #707070; font-size: 16px;">İndustry\'s&nbsp;make a type specimen book. It has survived not only five centuries, but also&nbsp;electronic typesetting, remaining essentially unchanged. It was populrised in the 1960&nbsp;containing Lorem Ipsum passages, and more recently.</p>
</td>
</tr>
<tr>
<td class="esd-block-text es-p20t" align="left">
<p style="color: #707070; font-size: 16px;">Lorem Visiosoft<br>Printing and typesetting team</p>
</td>
</tr>
<tr>
<td align="center" class="esd-block-spacer" height="29"></td>
</tr>
<tr>
<td align="center" class="esd-block-button es-p10"><span class="es-button-border" style="border-bottom-width: 0px; background: #ffb600; border-radius: 4px;"><a href class="es-button" target="_blank" style="background: #ffb600; border-color: #ffb600; border-radius: 4px; font-size: 16px;">LOREM IPSUM THERE</a></span></td>
</tr>
<tr>
<td align="center" class="esd-block-spacer es-p20" style="font-size:0">
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="border-bottom: 0px solid #cccccc; background: none; height: 1px; width: 100%; margin: 0px;"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>',
'name' => 'New User Welcome',
'subject' => 'Welcome | Openclassify.com'
],
'stream' => 'users',
'slug' => Str::slug('New User Welcome', '_')
]);
}
if (!$template_repo->findBySlug(Str::slug('Password Forget', '_'))) {
$template_repo->create([
'en' => [
'message' => '<tr>
<td class="esd-structure es-p20t es-p20b es-p20r es-p20l" align="left">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="esd-container-frame" width="560" valign="top" align="center">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="esd-block-text es-m-txt-l es-p15t es-p15b es-m-p15t es-m-p0b es-m-p0r es-m-p0l" align="left">
<h2 style="font-size: 26px;"><strong>Forgot your password?</strong></h2>
</td>
</tr>
<tr>
<td class="esd-block-text es-p20t" align="left">
<p style="color: #707070; font-size: 16px;">Hi user,</p>
</td>
</tr>
<tr>
<td class="esd-block-text es-p15t" align="left">
<p style="color: #707070; font-size: 16px;">Don\'t worry! Reseting you password is easy. Just type in the email you registered to&nbsp;openclassify.</p>
</td>
</tr>
<tr>
<td class="esd-block-text es-p20t" align="left">
<p style="color: #707070; font-size: 16px;">Lorem Visiosoft<br>Printing and typesetting team</p>
</td>
</tr>
<tr>
<td align="center" class="esd-block-spacer" height="29"></td>
</tr>
<tr>
<td align="center" class="esd-block-button es-p10"><span class="es-button-border" style="border-bottom-width: 0px; background: #ffb600; border-radius: 4px;"><a href class="es-button" target="_blank" style="background: #ffb600; border-color: #ffb600; border-radius: 4px; font-size: 16px;">CHANGE PASSWORD</a></span></td>
</tr>
<tr>
<td align="center" class="esd-block-text">
<p style="font-size: 11px; color: #707070;">Did you remember&nbsp;your password?&nbsp;<a target="_blank" style="font-size: 11px; ">Try logging in</a></p>
</td>
</tr>
<tr>
<td align="center" class="esd-block-spacer es-p20" style="font-size:0">
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="border-bottom: 0px solid #cccccc; background: none; height: 1px; width: 100%; margin: 0px;"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>',
'name' => 'Password Forget',
'subject' => 'Forgot Your Password | Openclassify.com'
],
'stream' => 'users',
'slug' => Str::slug('Password Forget', '_')
]);
}
if (!$template_repo->findBySlug('password_changed')) {
$template_repo->create([
'en' => [
'message' => '<p><strong>Your password has been changed</strong></p>',
'name' => 'Password Changed',
'greeting' => 'Hi',
'subject' => 'Password changed'
],
'stream' => 'users',
'slug' => 'password_changed'
]);
}
}
}
}

View File

@ -2,12 +2,16 @@
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Visiosoft\ProfileModule\Education\EducationSeeder;
use Visiosoft\ProfileModule\Notifications\ProfileModuleNotificationsTemplateSeeder;
use Visiosoft\ProfileModule\Seed\UsersFieldsSeeder;
class ProfileModuleSeeder extends Seeder
{
public function run()
{
//Notifications Template Seeder
$this->call(ProfileModuleNotificationsTemplateSeeder::class);
// Users Fields Seeder
$this->call(UsersFieldsSeeder::class);