Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-01-26 13:06:45 +00:00
parent 9cd82a849f
commit 9547c26947
25 changed files with 1314 additions and 1186 deletions

View File

@@ -36,3 +36,59 @@ 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)
}
```
## Validate
Validate an email address format
[https://m3o.com/email/api#Validate](https://m3o.com/email/api#Validate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/email"
)
// Validate an email address format
func ValidateEmail() {
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emailService.Validate(&email.ValidateRequest{
Address: "joe@example.com",
})
fmt.Println(rsp, err)
}
```