This episode is for members only

Sign up to access "Build An Uptime Monitor with Inertia" right now.

Get started
Already a member? Sign in to continue
Playing
40. Making the emails a bit friendlier

Episodes

0%
Your progress
  • Total: 4h 59m
  • Played: 0m
  • Remaining: 4h 59m
Join or sign in to track your progress

Transcript

00:00
So let's finish up notifications by just making these emails look a little bit nicer and to kind of cheat here what I like to do is go ahead and generate out if we just cancel these off quickly generate out a Laravel mail which we haven't done because we're using notifications and I'm just
00:16
going to call this test but I'm going to provide the markdown option in here and I'm going to say emails and dot test that will do so what that will have done is generated out a emails test.play.php obviously we're using email but it doesn't matter and it would have also generated out a test mail class here as well as well as our example one which we can actually get rid of now as well
00:42
so over in this test.play.php file is pretty much the markdown or some of the markdown functionality that we can use in Laravel emails this will be enough for us but you can go over to the docs to find out more so I'm going to go ahead and copy that delete that emails folder and we're pretty much just going to go ahead and start to fill in what we want inside of these emails so
01:03
let's go ahead and start with the went down email we're going to paste this in we've got an introduction header here this is all markdown we've got a button here which we can press which may be useful for going through to our dashboard so let's start with the header and we're going to go and do pretty much what we did in the subject and say endpoint location went down you might want
01:24
to include the site there as well because you might have multiple sites and I'm just going to go ahead and copy and paste over some copy that I wrote earlier very very simple obviously it looks like endpoint url so we've already seen that method over in the endpoint model that just gives the site url and the location it's down we'll email you and let you know when it is recovered
01:45
now for the button itself we're going to go ahead and say visit dashboard so the user can jump straight over to the dashboard obviously click on that endpoint we could even forward them over to the endpoint index where it shows all of the checks and then they can go through and inspect this so here we're just going to go ahead and route through to the dashboard let's just make
02:05
sure that we definitely kept the name for that so let's go up here to the dashboard and yeah we did so we can reference that by name and of course remember we want to go over to the correct site that's really really important we don't just want to hit the user on the dashboard because that will go over to their latest dashboard from remember from earlier we can provide in here the site id
02:26
or we could just pass the site model into this root function and that's going to move them over to the correct dashboard which is really important and that's pretty much it so we can really just copy this and paste this over into the recovered email and just start to change over some things that we need so i'm just going to switch this up to great news and then the endpoint url has
02:50
recovered that should do it and then again we can allow the user to go over and visit the dashboard it's exactly the same thing here okay so now that we've done that let's cancel off and rerun our queue let's rerun our scheduler and let's go ahead and check out these emails let's just delete what we've got in there so far and we're going to go ahead and force this down by changing the url
03:13
let's head over and see them emails roll in okay there we go that's a much nicer email it's the laravel standard template of course you can modify it but you'll agree this looks a little bit better we can hit visit dashboard that's going to send us straight over to our dashboard for that particular site so regardless of which site this is on that's going to forward you over to the
03:33
correct one and that looks good email looks good so let's change this over to the recovered email just so we can see what this looks like and there we go great news this is recovered so there we go just tidying up them emails giving a little bit more design to these making them look a little bit better
44 episodes4 hrs 59 mins

Overview

Ready to dive into Inertia? Let's build a real-world app with Laravel, Inertia and Vue! If you're already working with Inertia, you'll pick up some tips and techniques for future projects.

This uptime monitor allows you to create and switch between sites, then add endpoints to monitor with frequency intervals. Using the power of scheduling and queues, it'll automatically alert the email addresses you've added via the UI when an endpoint goes down.

In this course, you'll learn to:

  • Build a real app from scratch with Inertia
  • Work with Laravel queues
  • Perform actions on models at user-defined intervals
  • Work with sub-minute schedules in Laravel
  • Send out channel notifications with Laravel
  • Use API resources to simplify Inertia data
  • Organise apps with events and observers
  • Create modals in Vue
  • Perform inline editing with Inertia forms
Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.