Skip to content

Instantly share code, notes, and snippets.

View victorsteven's full-sized avatar

Victor Steven victorsteven

View GitHub Profile
package welcome_test
import (
"bytes"
"encoding/json"
"errors"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"mail-sending/handlers/welcome"
"mail-sending/helpers"
package main
import (
"context"
"fmt"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"log"
"mail-sending/emails/welcome_mail"
"mail-sending/handlers/welcome"
APP_PORT=8080
GMAIL_USERNAME=your-gmail
GMAIL_PASSWORD=your-gmail-password
GMAIL_SERVER=smtp.gmail.com
GMAIL_PORT=587
SENDGRID_API_KEY=your-sendgrid-api-key
SENDGRID_FROM=your-sendgrid-email
package welcome
import (
"github.com/gin-gonic/gin"
"mail-sending/emails/welcome_mail"
"mail-sending/helpers"
"net/http"
)
type service struct {
package welcome_mail
import (
"bytes"
"fmt"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/helpers/mail"
"html/template"
"mail-sending/helpers"
"net/smtp"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.Subject}}</title>
<style type="text/css">
html {
package models
import (
"errors"
"html"
"log"
"os"
"strings"
"time"
init:
go run github.com/99designs/gqlgen init
generate:
go run github.com/99designs/gqlgen && go run ./app/models/model_tags/model_tags.go
run:
go run main.go
test:
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
schema:
- app/schemas/*.graphql
# Where should the generated server code go?
exec:
filename: app/generated/generated.go
package: generated
# Uncomment to enable federation
DATABASE_DRIVER=postgres
DATABASE_USER=postgres
DATABASE_NAME=multi-choice
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_PASSWORD=password
TEST_DB_DRIVER=postgres
TEST_DB_HOST=127.0.0.1