Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Design:

Blank diagram

An addEmailServer is running, serving many async clients sending users' email id. This server adds these email ids to RabbitMQ. Another server (sendEmailServer) is running, which is serving clients asynchronously. It uses the sender email id and email body from the client requests; it consumes the receiver email id from RabbitMQ and sends an email using send grid API. The project uses gRPC in golang.

How to Run:

Step 1:

Setup rabbitMQ locally (instructions for mac)

brew install rabbitmq 
export PATH=$PATH:/usr/local/sbin 
rabbitmq-server start 

Step 2:

Setup project

Run go mod download from project root
From project root run cd emailService

Step 3:

Start local server to add email ids to RabbitMQ

Run go run addEmailServer/server.go

Step 4:

Send async request from add email client to add email ids (100 emails)

Run go run addEmailClient/client.go

Step 5:

Generate Send Grid Api Key and store it locally

Create an account with sendgrid and generate your API key reger
Create an environment variable with your API Key and registered email id

sendgrid.env echo "export SENDER_EMAIL_ID='YOUR-REGISTRED-EMAIL-ID" > sendgrid.env echo "sendgrid.env" >> .gitignore source ./sendgrid.env">
echo "export SENDGRID_API_KEY='YOUR-API-KEY'" > sendgrid.env
echo "export SENDER_EMAIL_ID='YOUR-REGISTRED-EMAIL-ID" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env

Step 6:

Start send grid server to consume email IDs from RabbitMQ and send emails using sengrid API

Run source ./sendgrid.env && go run sendgridServer/sendgridServer.go

Step 7:

Send async request from send email client to send emails to email ids consumed from RabbitMQ

Run source ./sendgrid.env && go run sendEmailClient/sendgridClient.go

Project Structure

├── LICENSE
├── Readme.md
├── emailService
│   ├── addEmailClient
│   │   └── client.go
│   ├── addEmailServer
│   │   └── server.go
│   ├── proto
│   │   ├── email.pb.go
│   │   ├── email.proto
│   │   └── email_grpc.pb.go
│   ├── sendEmailClient
│   │   └── sendgridClient.go
│   ├── sendEmailServer
│   │   └── sendgridServer.go
│   └── sendgrid.env
├── go.mod
└── go.sum
Owner
Shivanshu Raj Shrivastava
SDE @AppDynamics | k8s | Otel | Mentor GSoC '21 | IIT Roorkee '20 ECE | GSoC '20 @scorelab | Member @Kubernetes @scorelab @fossasia | Prev @Samsung
Shivanshu Raj Shrivastava
Similar Resources

VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients

VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients

VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients Email clients use different rendering standards. This is

Dec 17, 2022

Sort the emails contained in a .csv file into a text file

Go convert csv to txt This snippet of code allows you to sort the emails contained in a .csv file into a text file.

Nov 23, 2021

Using Mailchain, blockchain users can now send and receive rich-media HTML messages with attachments via a blockchain address.

Mailchain Introduction Mailchain enables blockchain-based email-like messaging with plain or rich text and attachment capabilities. Using blockchain p

Dec 28, 2022

Go-mail - Email service using Kafka consumer

📁 The Project This project consists in a Kafka consumer that reads messages of

Feb 5, 2022

Email 2.0 server

Email 2.0 server

RIGEL.Email Secure, fast and free email 2.0 server. Download latest version Linux, BSD, Mac OS X and Windows versions available. Supported fetures in

Jan 7, 2022

Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade

smtptest Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade All settings are configurable in the config.yaml file ser

Sep 19, 2022

Send markdown files as MIME-encoded electronic mail.

Send markdown files as MIME-encoded electronic mail.

Aug 9, 2022

Golang package that generates clean, responsive HTML e-mails for sending transactional mail

Golang package that generates clean, responsive HTML e-mails for sending transactional mail

Hermes Hermes is the Go port of the great mailgen engine for Node.js. Check their work, it's awesome! It's a package that generates clean, responsive

Dec 28, 2022

Go library for sending mail with the Mailgun API.

Mailgun with Go Go library for interacting with the Mailgun API. Usage package main import ( "context" "fmt" "log" "time" "githu

Dec 25, 2022
Related tags
✉️ A Go library for email verification without sending any emails.

email-verifier ✉️ A Go library for email verification without sending any emails. Features Email Address Validation: validates if a string contains a

Jun 24, 2021
A simple microservice designed in Go using Echo Microframework for sending emails and/or calendar invitations to users.

Calenvite A simple microservice designed in GO using Echo Microframework for sending emails and/or calendar invitations to users. Features Send emails

Oct 29, 2022
Hxgomail - Gomail - a simple and efficient package to send emails

Gomail Introduction Gomail is a simple and efficient package to send emails. It

Jan 4, 2022
The best way to send emails in Go.

Gomail Introduction Gomail is a simple and efficient package to send emails. It is well tested and documented. Gomail can only send emails using an SM

Dec 29, 2022
An easy way to send emails with attachments in Go

PROJECT DISCONTINUED This repository only exists for archival purposes. email An easy way to send emails with attachments in Go Install go get github.

Dec 12, 2022
Mail_sender - This library is for sending emails from your mail

Mail Sender This library is for sending emails from your mail Installation mail_

Dec 30, 2021
Pretty wrapper for sending email using go net/smtp

Emailer A pretty wrapper around go net/smtp send multiple email using single client func main() { var client *emailer.Client var clientX sync.Mute

Mar 23, 2022
Golang library for sending email using gmail credentials

library for sending email using gmail credentials

Jan 22, 2022
Golang package for send email. Support keep alive connection, TLS and SSL. Easy for bulk SMTP.

Go Simple Mail The best way to send emails in Go with SMTP Keep Alive and Timeout for Connect and Send. IMPORTANT Examples in this README are for v2.2

Jan 8, 2023
Email-searcher - Given a domain name and real name, attempt to find an existing email for that user.

email-searcher Given a domain name and real name, attempt to find an existing email for that user. Using Run it with both the domain and name flags, l

Jan 2, 2022