Merge pull request #1019 from openclassify/vedatakd

notifications template
This commit is contained in:
Ozcan Durak 2021-04-09 10:45:05 +03:00 committed by GitHub
commit d0416b8ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 251 additions and 1 deletions

View File

@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
use Intervention\Image\Facades\Image;
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
use Anomaly\Streams\Platform\Entry\EntryRepository;
use Visiosoft\AdvsModule\Support\Command\Currency;
use Visiosoft\CatsModule\Category\CategoryModel;
use Visiosoft\LocationModule\City\CityModel;
use Visiosoft\LocationModule\Country\CountryModel;
@ -419,6 +420,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
foreach ($ads as $index => $ad) {
$ads[$index]->detail_url = $this->model->getAdvDetailLinkByModel($ad, 'list');
$ads[$index]->currency_price = app(Currency::class)->format($ad->price,$ad->currency);
$ads[$index] = $this->model->AddAdsDefaultCoverImage($ad);
}

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,76 @@
<?php namespace Visiosoft\AdvsModule\Notifications;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Support\Str;
use Visiosoft\NotificationsModule\Template\Command\CreateTemplate;
use Visiosoft\NotificationsModule\Template\Contract\TemplateRepositoryInterface;
class AdvsModuleNotificationsTemplateSeeder extends Seeder
{
use DispatchesJobs;
public function run()
{
if (is_module_installed('visiosoft.module.notifications')) {
$templates = [
[
'en' => [
'message' => '<p><strong>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', '_')
],
[
'en' => [
'message' => '<p><strong>Your ad for<a href="{url}" target="_blank">{name}</a>has been approved.</strong></p>',
'name' => 'Approved Ad',
'greeting' => 'Hi',
'subject' => 'Approved Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Approved Ad', '_')
],
[
'en' => [
'message' => '<p><strong>Your <a href="{url}" target="_blank">{name}</a>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', '_')
],
[
'en' => [
'message' => '<p><strong>You must confirm your <a href="{url}" target="_blank">{name}</a>posting to be published.</strong></p>',
'name' => 'Pending User Ad',
'greeting' => 'Hi',
'subject' => 'Pending User Ad'
],
'stream' => 'advs',
'slug' => Str::slug('Pending User Ad', '_')
],
[
'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', '_')
]
];
foreach ($templates as $template) {
$this->dispatchNow(new CreateTemplate($template));
}
}
}
}

View File

@ -3,4 +3,5 @@
return [
'send_forgot_sms' => 'SMS sent to your registered phone. Please check.',
'found_phone' => 'The phone number registered in the system was not found.',
'error_mail' => 'Your transaction was completed successfully, but the notification e-mail could not be sent.',
];

View File

@ -3,4 +3,5 @@
return [
'send_forgot_sms' => 'Kayıtlı telefonunuza SMS gönderildi. Lütfen kontrol edin.',
'found_phone' => 'Sistemde kayıtlı olan telefon numarası bulunamadı.',
'error_mail' => 'İşleminiz başarıyla gerçekleştirildi.Ancak bilgilendirme maili gönderilemedi.',
];

View File

@ -0,0 +1,158 @@
<?php namespace Visiosoft\ProfileModule\Notifications;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Support\Str;
use Visiosoft\NotificationsModule\Template\Command\CreateTemplate;
use Visiosoft\NotificationsModule\Template\Contract\TemplateRepositoryInterface;
class ProfileModuleNotificationsTemplateSeeder extends Seeder
{
use DispatchesJobs;
public function run()
{
if (is_module_installed('visiosoft.module.notifications')) {
$templates = [
[
'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', '_')
],
[
'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;"></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;"></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', '_')
],
[
'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 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 your password?<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', '_')
],
[
'en' => [
'message' => '<p><strong>Your password has been changed</strong></p>',
'name' => 'Password Changed',
'greeting' => 'Hi',
'subject' => 'Password changed'
],
'stream' => 'users',
'slug' => 'password_changed'
],
];
foreach ($templates as $template) {
$this->dispatchNow(new CreateTemplate($template));
}
}
}
}

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);

View File

@ -9,6 +9,7 @@ use Illuminate\Foundation\Exceptions\Handler;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Swift_TransportException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
@ -86,7 +87,6 @@ class ExceptionHandler extends Handler
public function report(Exception $e)
{
if (app()->bound('sentry')
&& $this->shouldReport($e)
&& env('SENTRY_LARAVEL_DSN')) {
@ -95,6 +95,10 @@ class ExceptionHandler extends Handler
}
}
if ($e instanceof Swift_TransportException) {
die(trans('visiosoft.theme.base::message.error_mail'));
}
parent::report($e);
}