| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package mail | 5 package mail |
| 6 | 6 |
| 7 // Interface is the interface for all of the mail methods. | 7 import ( |
| 8 » "golang.org/x/net/context" |
| 9 ) |
| 10 |
| 11 // RawInterface is the interface for all of the mail methods. |
| 8 // | 12 // |
| 9 // These replicate the methods found here: | 13 // These replicate the methods found here: |
| 10 // https://godoc.org/google.golang.org/appengine/mail | 14 // https://godoc.org/google.golang.org/appengine/mail |
| 11 type Interface interface { | 15 type RawInterface interface { |
| 12 Send(msg *Message) error | 16 Send(msg *Message) error |
| 13 SendToAdmins(msg *Message) error | 17 SendToAdmins(msg *Message) error |
| 14 | 18 |
| 15 » Testable() Testable | 19 » GetTestable() Testable |
| 16 } | 20 } |
| 21 |
| 22 // Send sends an e-mail message. |
| 23 func Send(c context.Context, msg *Message) error { |
| 24 return Raw(c).Send(msg) |
| 25 } |
| 26 |
| 27 // SendToAdmins sends an e-mail message to application administrators. |
| 28 func SendToAdmins(c context.Context, msg *Message) error { |
| 29 return Raw(c).SendToAdmins(msg) |
| 30 } |
| 31 |
| 32 // GetTestable returns a testable extension interface, or nil if one is not |
| 33 // available. |
| 34 func GetTestable(c context.Context) Testable { |
| 35 return Raw(c).GetTestable() |
| 36 } |
| OLD | NEW |