Skip to content

Instantly share code, notes, and snippets.

@mrsimonbennett
Last active April 2, 2018 01:38
Show Gist options
  • Save mrsimonbennett/94895430c6c7560f6e777869e485d480 to your computer and use it in GitHub Desktop.
Save mrsimonbennett/94895430c6c7560f6e777869e485d480 to your computer and use it in GitHub Desktop.
<?php
$browser->visit('Login')
->tap(
function (Browser $browser) {
$points = $browser->resolver->find("#TotalCount")->getText();
$this->mailer->send(
'mail',
['points' => $points],
function (Message $mailable) use ($browser, $points) {
$mailable->from('[email protected]', 'Pixelated Bot');
$mailable->to('[email protected]', 'Someone ');
$mailable->subject($points . ' - Points');
$mailable->attachData($browser->driver->takeScreenshot(), 'points.png');
}
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment