Chapter 12. Sending email

 

This chapter covers

  • Sending and testing emails with Action Mailer and Email Spec
  • Using a service class to combine updating tickets and sending notifications
  • Adding the ability to subscribe to and unsubscribe from notifications

In the previous chapter, you implemented tagging for your application, which allows users to easily categorize and search for tickets. In this chapter, you’ll begin to send emails to your users. When a user signs up to Ticketee, they use their email address as a way for the system to uniquely identify them. Once you have a user’s validated email address, you can send them updates about important events in the system, such as a ticket being updated.

Before you go about configuring your application to send emails into the real world, you’ll add two more features to Ticketee. The first feature automatically subscribes a user to a watchers list whenever that user creates a ticket. Every time this ticket is updated by another user, the creator of the ticket should receive an email. This is helpful, because it allows users to keep up to date with the tickets they’ve created. The second feature will allow users to add themselves to or remove themselves from the watchers list for a given ticket.

12.1. Sending ticket notifications

12.2. Subscribing to updates

12.3. Summary