Created
November 18, 2015 07:09
-
-
Save cod3beat/809de0a30868889c7dff to your computer and use it in GitHub Desktop.
Event Mailer Service Provider
This file contains hidden or 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
<?php | |
class EventMailerServiceProvider extends ServiceProvider | |
{ | |
public function register() | |
{ | |
// Ketika seluruh event dari Domain Challenge dibangkitkan, maka kita jalankan ChallengeEventMailer | |
// untuk menangani event tersebut. | |
\Event::listen('Dicoding.Domain.Challenge.*', 'Dicoding\Infrastructure\Emailing\Challenge\ChallengeEventMailer'); | |
} | |
} | |
// Contoh wujud dari ChallengeEventMailer | |
class ChallengeEventMailer extends EventListener | |
{ | |
public function whenUnpublishedChallengeWasPublished($job, $data) | |
{ | |
// jalankan tugas pengiriman email | |
} | |
public function whenUnpublishedChallengeWasCreated($job, $data) | |
{ | |
} | |
// dsb | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment