Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <georgelemon@protonmail.com>
  • Loading branch information
georgelemon committed Apr 1, 2024
1 parent 83809d6 commit c2e120f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
3 changes: 0 additions & 3 deletions mailersend.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ requires "nim >= 2.0.2"
# requires "jsony#head"
requires "https://github.com/georgelemon/jsony#extend-skip-hook"

task dev, "build dev":
exec "nimble build -d:ssl -f"

task build_email, "build /email":
exec "nim c -d:ssl -o:./bin/email src/mailersend/email.nim"
18 changes: 11 additions & 7 deletions src/mailersend.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# This is just an example to get you started. A typical library package
# exports the main API in this file. Note that you cannot rename this file
# but you can remove it if you wish.

proc add*(x, y: int): int =
## Adds two numbers together.
return x + y
# Asynchronous Nim client for
# interacting with the MailerSend API
#
# Official MailerSend Documentation:
# https://developers.mailersend.com
#
# (c) 2024 George Lemon | MIT License
# Made by Humans from OpenPeeps
# https://github.com/openpeeps/mailersend-nim
import mailersend/[meta, email]
export meta, email
2 changes: 1 addition & 1 deletion src/mailersend/email.nim
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@ when isMainModule:
.setFrom("GoodGuest.ro", "noreply@goodguest.ro")
.setTo("George Lemon", "georgelemon@protonmail.com")
.setText("This is a plain text messsage")
# echo waitFor mls.send(mail)
echo waitFor mls.send(mail)
echo waitFor mls.getQuota()
24 changes: 14 additions & 10 deletions tests/test1.nim
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# This is just an example to get you started. You may wish to put all of your
# tests into a single file, or separate them into multiple `test1`, `test2`
# etc. files (better names are recommended, just make sure the name starts with
# the letter 't').
#
# To run these tests, simply execute `nimble test`.
# import unittest, mailersend

import unittest
# import dotenv
# from std/os import getEnv
# from std/macros import getProjectPath

import mailersend
test "can add":
check add(5, 5) == 10
# test "can add":
# dotenv.load(getProjectPath())
# var mls = initMailerSend(getEnv("api_key"))
# let mail = newEmail()
# mail.setSubject("Test email - This is a subject")
# .setFrom("GoodGuest.ro", "noreply@goodguest.ro")
# .setTo("George Lemon", "georgelemon@protonmail.com")
# .setText("This is a plain text messsage")
# # echo waitFor mls.send(mail)
# echo waitFor mls.getQuota()

0 comments on commit c2e120f

Please sign in to comment.