A doggy door that leads into a secure yard is a great convenience for you and your dog; ultimately it's ideal for minimizing accidents for a lifetime. A puppy will have to adequately understand several different aspects of potty training to master the use of the doggy door. Your work's plentiful, but it's simple. If the door's in place when you bring the puppy home, teach the door first, then potty-training.
Prepare to teach your puppy to walk through the doggy door. Puppies don't generally recognize a doggy door for what it is; when they do, they don't necessarily care to immediately want to go through one. Set up a small, confined area inside your home that gives your dog full access to the doggy door while restricting his access to the rest of the house. You can use a baby gate or playpen-style setup to fence off this area surrounding the door.
Place your puppy in his barricaded environment inside the house and stand on the outside of the house, just outside the doggy door. Open the doggy door call the puppy to the door if he's not there already, and allow him to inspect the doggy door and investigate it on his own. If your puppy is fearful of the movement of the flaps, you may want to tape them to the sides of the door until your puppy gets used to going through the door.
Call your puppy and encourage him to come to you. Offer him treats and praise when he comes through the door to you. Repeat the process from both sides of the doggy door until your puppy walks through the doggy door without fear or hesitation. As with any dog training, keep the session and subsequent sessions brief but frequent.
Teach your puppy to use the bathroom outside. When you notice your puppy behaving in a manner that suggests he needs to use the bathroom or if he has not gone to the bathroom for a long period of time, go outside and then call him to come outside through the doggy door. Use treats or verbal praise to reward him for coming outside by using the doggy door, and reward him again when he uses the bathroom. Repeat this process as many times as necessary until your puppy figures out that going through the doggy door to use the bathroom is desirable behavior and he begins to do it on his own. He may expect a treat when he comes in; at some point after he's trained, you may choose to stop treating.