mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/email/api](htt
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Parse
|
||||
|
||||
Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
|
||||
|
||||
|
||||
[https://m3o.com/email/api#Parse](https://m3o.com/email/api#Parse)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/email"
|
||||
)
|
||||
|
||||
// Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
|
||||
func ParseEmail() {
|
||||
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emailService.Parse(&email.ParseRequest{
|
||||
Address: "Joe Blogs <joe@example.com>",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
## Validate
|
||||
|
||||
Validate an email address format
|
||||
@@ -92,3 +64,31 @@ Please verify your email by clicking this link: $micro_verification_link`,
|
||||
|
||||
}
|
||||
```
|
||||
## Parse
|
||||
|
||||
Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
|
||||
|
||||
|
||||
[https://m3o.com/email/api#Parse](https://m3o.com/email/api#Parse)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/email"
|
||||
)
|
||||
|
||||
// Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
|
||||
func ParseEmail() {
|
||||
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := emailService.Parse(&email.ParseRequest{
|
||||
Address: "Joe Blogs <joe@example.com>",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user