Skip to content

Instantly share code, notes, and snippets.

@mrsimonbennett
Last active April 2, 2018 01:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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('bot@pixelatedcrow.com', 'Pixelated Bot');
$mailable->to('someone@example.com', '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