app/Notifications/Configurable/DeploymentSucceeded.php
<?php
namespace REBELinBLUE\Deployer\Notifications\Configurable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use NotificationChannels\Twilio\TwilioSmsMessage as TwilioMessage;
use NotificationChannels\Webhook\WebhookMessage;
use REBELinBLUE\Deployer\Channel;
/**
* Notification sent when a deployment succeeds.
*/
class DeploymentSucceeded extends DeploymentFinished
{
/**
* Get the mail representation of the notification.
*
* @param Channel $notification
*
* @return MailMessage
*/
public function toMail(Channel $notification)
{
return $this->buildMailMessage(
'deployments.success_email_subject',
'deployments.success_email_message',
$notification
)->success();
}
/**
* Get the slack version of the notification.
*
* @param Channel $notification
*
* @return SlackMessage
*/
public function toSlack(Channel $notification)
{
return $this->buildSlackMessage(
'deployments.success_slack_message',
$notification
)->success();
}
/**
* Get the webhook version of the notification.
*
* @param Channel $notification
*
* @return WebhookMessage
*/
public function toWebhook(Channel $notification)
{
return $this->buildWebhookMessage('deployment_succeeded', $notification);
}
/**
* Gets the Twilio version of the notification.
*
* @return TwilioMessage
*/
public function toTwilio()
{
return $this->buildTwilioMessage('deployments.success_sms_message');
}
}