-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
email sender works, and create a skipable unit test for it
Signed-off-by: Shubham Singh <[email protected]>
- Loading branch information
Showing
6 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,6 @@ TOKEN_SYMMETRIC_KEY=12345678901234567890123456789012 | |
ACCESS_TOKEN_DURATION=30m | ||
REFRESH_TOKEN_DURATION=48h | ||
|
||
EMAIL_SENDER_NAME=Shubham | ||
EMAIL_SENDER_NAME=[email protected] | ||
EMAIL_SENDER_ADDRESS=[email protected] | ||
EMAIL_SENDER_PASSWORD=cezs reyw kgku gggj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,25 @@ import ( | |
) | ||
|
||
func TestSendEmail(t *testing.T) { | ||
assert := assert.New(t) | ||
// to skip the test | ||
if testing.Short(){ | ||
t.Skip() | ||
} | ||
|
||
assert := assert.New(t) | ||
config, err := util.LoadConfig("..") | ||
assert.NoError(err) | ||
|
||
sender := NewGmailSender(config.EmailSenderName, config.EmailSenderAddress, config.EmailSenderPassword) | ||
|
||
subject := "I hate Soan Papdi and Momos" | ||
|
||
content := ` | ||
<H1>Hey There</H1> | ||
<p>I want to condess someting. this things has been eating me up from year and now i can't stop but tell you about it. | ||
I want to telle you that I hate Soan Papdi, it tastes like medicine. And momos, they taste like </p> | ||
<p> I don't know why this is not working</p> | ||
` | ||
|
||
to := []string{"[email protected]"} | ||
|