-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Temp consutation and webnar to mail * Add templates for events approved and reject * Add variables to register temp * Add setTimezone for datetimes * Repair tests * add assert to test * add assert to test * add assert to test * add assert to test Co-authored-by: Hubert Krzysztofiak <[email protected]>
- Loading branch information
Showing
10 changed files
with
149 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace EscolaLms\TemplatesEmail\Consultations; | ||
|
||
class ApprovedTermWithTrainerVariables extends CommonConsultationVariables | ||
{ | ||
public static function defaultSectionsContent(): array | ||
{ | ||
return [ | ||
'title' => __('Approved term ":consultation"', [ | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
]), | ||
'content' => self::wrapWithMjml(__('<h1>Hello :user_name!</h1><p>You approved term :proposed_term for consultation ":consultation".</p>', [ | ||
'user_name' => self::VAR_USER_NAME, | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
'proposed_term' => self::VAR_CONSULTATION_PROPOSED_TERM | ||
])), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace EscolaLms\TemplatesEmail\Consultations; | ||
|
||
class RejectTermWithTrainerVariables extends CommonConsultationVariables | ||
{ | ||
public static function defaultSectionsContent(): array | ||
{ | ||
return [ | ||
'title' => __('Reject term ":consultation"', [ | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
]), | ||
'content' => self::wrapWithMjml(__('<h1>Hello :user_name!</h1><p>You rejected term :proposed_term for consultation ":consultation".</p>', [ | ||
'user_name' => self::VAR_USER_NAME, | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
'proposed_term' => self::VAR_CONSULTATION_PROPOSED_TERM | ||
]),), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace EscolaLms\TemplatesEmail\Consultations; | ||
|
||
use EscolaLms\Templates\Events\EventWrapper; | ||
|
||
class ReminderTrainerAboutTermVariables extends CommonConsultationVariables | ||
{ | ||
const VAR_CONSULTATION_USER_NAME = '@VarConsultationUserName'; | ||
|
||
public static function requiredVariables(): array | ||
{ | ||
return array_merge(parent::requiredVariables(), [ | ||
self::VAR_CONSULTATION_USER_NAME, | ||
]); | ||
} | ||
|
||
public static function requiredVariablesInSection(string $sectionKey): array | ||
{ | ||
if ($sectionKey === 'content') { | ||
return array_merge(parent::requiredVariablesInSection($sectionKey), [ | ||
self::VAR_CONSULTATION_USER_NAME, | ||
]); | ||
} | ||
return []; | ||
} | ||
|
||
public static function variablesFromEvent(EventWrapper $event): array | ||
{ | ||
return array_merge(parent::variablesFromEvent($event), [ | ||
self::VAR_CONSULTATION_USER_NAME => $event->getConsultationTerm()->user->name, | ||
]); | ||
} | ||
|
||
public static function defaultSectionsContent(): array | ||
{ | ||
return [ | ||
'title' => __('Remind term ":consultation"', [ | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
]), | ||
'content' => self::wrapWithMjml(__('<h1>Hello :user_name!</h1><p>I would like to remind you about the upcoming consultation :consultation with :consultation_user_name, which will take place :proposed_term.</p>', [ | ||
'user_name' => self::VAR_USER_NAME, | ||
'consultation_user_name' => self::VAR_CONSULTATION_USER_NAME, | ||
'consultation' => self::VAR_CONSULTATION_TITLE, | ||
'proposed_term' => self::VAR_CONSULTATION_PROPOSED_TERM | ||
]),), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::group(['prefix' => 'api'], function () { | ||
Route::middleware('auth:api')->prefix('admin')->group(function () { | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters