Skip to content

Commit

Permalink
Merge pull request #776 from supertokens/golang-smtp
Browse files Browse the repository at this point in the history
fix: golang smtp update
  • Loading branch information
rishabhpoddar authored Feb 8, 2024
2 parents e604524 + b080527 commit d024822
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 7 deletions.
10 changes: 9 additions & 1 deletion v2/emailpassword/email-delivery/smtp/configure-smtp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ import (
"github.com/supertokens/supertokens-golang/recipe/emailverification"
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
"github.com/supertokens/supertokens-golang/supertokens"

"crypto/tls"
)

func main() {
Expand All @@ -92,10 +94,16 @@ func main() {
Name: "...",
Email: "...",
},
Port: 456,
Port: 465,
Username: &smtpUsername, // this is optional. In case not given, from.email will be used
Password: "...",
Secure: false,

// this is optional. TLS config is used if Secure is set to true, or server supports STARTTLS
// if not provided, the SDK will use a default config
TLSConfig: &tls.Config{
// ...
},
}
// highlight-end

Expand Down
10 changes: 9 additions & 1 deletion v2/passwordless/email-delivery/smtp/configure-smtp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ import (
"github.com/supertokens/supertokens-golang/recipe/passwordless"
"github.com/supertokens/supertokens-golang/recipe/passwordless/plessmodels"
"github.com/supertokens/supertokens-golang/supertokens"

"crypto/tls"
)

func main() {
Expand All @@ -79,10 +81,16 @@ func main() {
Name: "...",
Email: "...",
},
Port: 456,
Port: 465,
Username: &smtpUsername, // this is optional. In case not given, from.email will be used
Password: "...",
Secure: false,

// this is optional. TLS config is used if Secure is set to true, or server supports STARTTLS
// if not provided, the SDK will use a default config
TLSConfig: &tls.Config{
// ...
},
},
}),
},
Expand Down
2 changes: 1 addition & 1 deletion v2/src/plugins/codeTypeChecking/goEnv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/go-chi/cors v1.2.1
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/supertokens/supertokens-golang v0.17.1
github.com/supertokens/supertokens-golang v0.17.4
)

require (
Expand Down
4 changes: 2 additions & 2 deletions v2/src/plugins/codeTypeChecking/goEnv/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/supertokens/supertokens-golang v0.17.1 h1:uuYmYio7+T4HmrqyVfxUAmdMTcIsYRIBTod+h/DFW0Q=
github.com/supertokens/supertokens-golang v0.17.1/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
github.com/supertokens/supertokens-golang v0.17.4 h1:G5FngSJpGjlLG/t+xQtVnq0XkMjhAkZivmmEwgZ2gD4=
github.com/supertokens/supertokens-golang v0.17.4/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
github.com/twilio/twilio-go v0.26.0 h1:wFW4oTe3/LKt6bvByP7eio8JsjtaLHjMQKOUEzQry7U=
github.com/twilio/twilio-go v0.26.0/go.mod h1:lz62Hopu4vicpQ056H5TJ0JE4AP0rS3sQ35/ejmgOwE=
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
Expand Down
8 changes: 8 additions & 0 deletions v2/thirdparty/email-delivery/smtp/configure-smtp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ import (
"github.com/supertokens/supertokens-golang/recipe/emailverification"
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
"github.com/supertokens/supertokens-golang/supertokens"

"crypto/tls"
)

func main() {
Expand All @@ -85,6 +87,12 @@ func main() {
Username: &smtpUsername, // this is optional. In case not given, from.email will be used
Password: "...",
Secure: false,

// this is optional. TLS config is used if Secure is set to true, or server supports STARTTLS
// if not provided, the SDK will use a default config
TLSConfig: &tls.Config{
// ...
},
}
// highlight-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ import (
"github.com/supertokens/supertokens-golang/recipe/emailverification"
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
"github.com/supertokens/supertokens-golang/supertokens"

"crypto/tls"
)

func main() {
Expand All @@ -92,10 +94,16 @@ func main() {
Name: "...",
Email: "...",
},
Port: 456,
Port: 465,
Username: &smtpUsername, // this is optional. In case not given, from.email will be used
Password: "...",
Secure: false,

// this is optional. TLS config is used if Secure is set to true, or server supports STARTTLS
// if not provided, the SDK will use a default config
TLSConfig: &tls.Config{
// ...
},
}
// highlight-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ import (
"github.com/supertokens/supertokens-golang/recipe/thirdpartypasswordless"
"github.com/supertokens/supertokens-golang/recipe/thirdpartypasswordless/tplmodels"
"github.com/supertokens/supertokens-golang/supertokens"

"crypto/tls"
)

func main() {
Expand All @@ -89,10 +91,16 @@ func main() {
Name: "...",
Email: "...",
},
Port: 456,
Port: 465,
Username: &smtpUsername, // this is optional. In case not given, from.email will be used
Password: "...",
Secure: false,

// this is optional. TLS config is used if Secure is set to true, or server supports STARTTLS
// if not provided, the SDK will use a default config
TLSConfig: &tls.Config{
// ...
},
}
// highlight-end

Expand Down

0 comments on commit d024822

Please sign in to comment.